diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-07-18 15:39:29 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-07-18 15:39:29 +0200 |
commit | 51e6ce820bd43e51883eddf291bd830217bb6382 (patch) | |
tree | 09c8a4bc00eb4aaec3652f1e8c1941da63232d09 /fs/xfs | |
parent | 9951934d76b04570d4ccbc8d768530b6b7d69edf (diff) | |
parent | 1b4f42a1e33fec999e94802df13dbd7521315742 (diff) | |
download | linux-rt-51e6ce820bd43e51883eddf291bd830217bb6382.tar.gz |
Merge branch 'dedupe-cleanup' into overlayfs-next
Following series for stacking overlay files depends on this mini series.
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_file.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index a3e7767a5715..0f40ba54d83f 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -933,31 +933,16 @@ xfs_file_clone_range( len, false); } -STATIC ssize_t +STATIC int xfs_file_dedupe_range( - struct file *src_file, - u64 loff, - u64 len, - struct file *dst_file, - u64 dst_loff) + struct file *file_in, + loff_t pos_in, + struct file *file_out, + loff_t pos_out, + u64 len) { - struct inode *srci = file_inode(src_file); - u64 max_dedupe; - int error; - - /* - * Since we have to read all these pages in to compare them, cut - * it off at MAX_RW_COUNT/2 rounded down to the nearest block. - * That means we won't do more than MAX_RW_COUNT IO per request. - */ - max_dedupe = (MAX_RW_COUNT >> 1) & ~(i_blocksize(srci) - 1); - if (len > max_dedupe) - len = max_dedupe; - error = xfs_reflink_remap_range(src_file, loff, dst_file, dst_loff, + return xfs_reflink_remap_range(file_in, pos_in, file_out, pos_out, len, true); - if (error) - return error; - return len; } STATIC int |