History

vfs: introduce generic_copy_file_range()

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.

Dave Chinner committed 7 years ago

Commit f16acc91 parent d1fdb6d2 files · +35 −3Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/fs.h+3−0
@@ -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);
1890extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,1890extern 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);
1892extern 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);
1892extern int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,1895extern 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,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t