Right now if vfs_copy_file_range() does not use any offload mechanism, it falls back to calling do_splice_direct(). This fails to do basic sanity checks on the files being copied. Before we start adding this necessarily functionality to the fallback path, separate it out into generic_copy_file_range(). generic_copy_file_range() has the same prototype as ->copy_file_range() so that filesystems can use it in their custom ->copy_file_range() method if they so choose.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -1889,6 +1889,9 @@ extern ssize_t vfs_readv(struct file *, const struct iovec __user *, · 1888 unmodified lines | |||
| 1889 | unsigned long, loff_t *, rwf_t); | 1889 | unsigned long, loff_t *, rwf_t); |
| 1890 | extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *, | 1890 | extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *, |
| 1891 | loff_t, size_t, unsigned int); | 1891 | loff_t, size_t, unsigned int); |
| 1892 | extern ssize_t generic_copy_file_range(struct file *file_in, loff_t pos_in, | ||
| 1893 | struct file *file_out, loff_t pos_out, | ||
| 1894 | size_t len, unsigned int flags); | ||
| 1892 | extern int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in, | 1895 | extern int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in, |
| 1893 | struct file *file_out, loff_t pos_out, | 1896 | struct file *file_out, loff_t pos_out, |
| 1894 | loff_t *count, | 1897 | loff_t *count, |