From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2016ECB for ; Mon, 4 Dec 2023 00:37:37 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 5551D68AFE; Mon, 4 Dec 2023 09:37:33 +0100 (CET) Date: Mon, 4 Dec 2023 09:37:33 +0100 From: Christoph Hellwig To: Amir Goldstein Cc: Christian Brauner , Jeff Layton , Josef Bacik , Christoph Hellwig , Jan Kara , David Howells , Jens Axboe , Miklos Szeredi , Al Viro , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 1/3] fs: fork splice_file_range() from do_splice_direct() Message-ID: <20231204083733.GA32438@lst.de> References: <20231130141624.3338942-1-amir73il@gmail.com> <20231130141624.3338942-2-amir73il@gmail.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231130141624.3338942-2-amir73il@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) > put_rd_wr_caps(src_ci, src_got, dst_ci, dst_got); > - ret = do_splice_direct(src_file, &src_off, dst_file, > - &dst_off, src_objlen, flags); > + ret = splice_file_range(src_file, &src_off, dst_file, &dst_off, > + src_objlen); Shouldb't ceph be switched to use generic_copy_file_range? That does the capping of the size which we want, and doesn't update the file offsets, which would require recalculation in the ceph code. But this could avoid another exported API as splice_file_range could simply be folded into generic_copy_file_range which should reduce confusion. And splice really is a mess for so many different layers of the onion being exposed. I've been wanting to reduce some of that for a while but haven't found a really nice way yet.