diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-10-29 19:41:49 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2018-10-29 19:41:49 -0400 |
commit | 42ec3d4c02187a18e27ff94b409ec27234bf2ffd (patch) | |
tree | c9db04db8187c370718a43e6067af0e5aa944500 /mm/filemap.c | |
parent | 8dde90bca6fca3736ea20109654bcf6dcf2ecf1d (diff) |
vfs: make remap_file_range functions take and return bytes completed
Change the remap_file_range functions to take a number of bytes to
operate upon and return the number of bytes they operated on. This is a
requirement for allowing fs implementations to return short clone/dedupe
results to the user, which will enable us to obey resource limits in a
graceful manner.
A subsequent patch will enable copy_file_range to signal to the
->clone_file_range implementation that it can handle a short length,
which will be returned in the function's return value. For now the
short return is not implemented anywhere so the behavior won't change --
either copy_file_range manages to clone the entire range or it tries an
alternative.
Neither clone ioctl can take advantage of this, alas.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 410dc58f7b16..e9091d731f84 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2994,7 +2994,7 @@ EXPORT_SYMBOL(generic_write_checks); | |||
2994 | */ | 2994 | */ |
2995 | int generic_remap_checks(struct file *file_in, loff_t pos_in, | 2995 | int generic_remap_checks(struct file *file_in, loff_t pos_in, |
2996 | struct file *file_out, loff_t pos_out, | 2996 | struct file *file_out, loff_t pos_out, |
2997 | uint64_t *req_count, unsigned int remap_flags) | 2997 | loff_t *req_count, unsigned int remap_flags) |
2998 | { | 2998 | { |
2999 | struct inode *inode_in = file_in->f_mapping->host; | 2999 | struct inode *inode_in = file_in->f_mapping->host; |
3000 | struct inode *inode_out = file_out->f_mapping->host; | 3000 | struct inode *inode_out = file_out->f_mapping->host; |