aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-07-06 17:57:03 -0400
committerMiklos Szeredi <mszeredi@redhat.com>2018-07-06 17:57:03 -0400
commit5740c99e9d30b81fcc478797e7215c61e241f44e (patch)
treebb10f2f28245c18457980e307348492ea7d69602 /fs/xfs
parent92b66d2cdd7a4f6f6aa31be5f16a3f0c88902690 (diff)
vfs: dedupe: return int
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_file.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index a3e7767a5715..547ef7e8aec1 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -933,7 +933,7 @@ xfs_file_clone_range(
933 len, false); 933 len, false);
934} 934}
935 935
936STATIC ssize_t 936STATIC int
937xfs_file_dedupe_range( 937xfs_file_dedupe_range(
938 struct file *src_file, 938 struct file *src_file,
939 u64 loff, 939 u64 loff,
@@ -941,23 +941,8 @@ xfs_file_dedupe_range(
941 struct file *dst_file, 941 struct file *dst_file,
942 u64 dst_loff) 942 u64 dst_loff)
943{ 943{
944 struct inode *srci = file_inode(src_file); 944 return xfs_reflink_remap_range(src_file, loff, dst_file, dst_loff,
945 u64 max_dedupe;
946 int error;
947
948 /*
949 * Since we have to read all these pages in to compare them, cut
950 * it off at MAX_RW_COUNT/2 rounded down to the nearest block.
951 * That means we won't do more than MAX_RW_COUNT IO per request.
952 */
953 max_dedupe = (MAX_RW_COUNT >> 1) & ~(i_blocksize(srci) - 1);
954 if (len > max_dedupe)
955 len = max_dedupe;
956 error = xfs_reflink_remap_range(src_file, loff, dst_file, dst_loff,
957 len, true); 945 len, true);
958 if (error)
959 return error;
960 return len;
961} 946}
962 947
963STATIC int 948STATIC int