On Thu 30-11-23 12:09:09, Amir Goldstein wrote: > On Wed, Nov 29, 2023 at 10:07 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > > > The new helper is meant to be called from context of ->copy_file_range() > > methods instead of do_splice_direct(). > > > > Currently, the only difference is that do_splice_copy_file_range() does > > not take a splice flags argument and it asserts that file_start_write() > > was called. > > > > Soon, do_splice_direct() will be called without file_start_write() held. > > > > Use the new helper from __ceph_copy_file_range(), that was incorrectly > > passing the copy_file_range() flags argument as splice flags argument > > to do_splice_direct(). the value of flags was 0, so no actual bug fix. > > > > Move the definition of both helpers to linux/splice.h. > > > > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> ... > > +/** > > + * do_splice_copy_file_range - splices data for copy_file_range() > > + * @in: file to splice from > > + * @ppos: input file offset > > + * @out: file to splice to > > + * @opos: output file offset > > + * @len: number of bytes to splice > > + * > > + * Description: > > + * For use by generic_copy_file_range() and ->copy_file_range() methods. > > + * > > + * Callers already called rw_verify_area() on the entire range. > > + */ > > +long do_splice_copy_file_range(struct file *in, loff_t *ppos, struct file *out, > > + loff_t *opos, size_t len) > > FYI, I renamed do_splice_vfs_copy_file_range => splice_file_range in v2 > for brevity. Yeah, after the rename things look better :). Otherwise I didn't find any problem so feel free to add: Reviewed-by: Jan Kara <jack@xxxxxxx> Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR