Merge tag 'for-4.19-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[linux-2.6-block.git] / fs / btrfs / ioctl.c
index 011ddfcc96e2d5a483663c7fcf2206fd7580ed9b..d60b6caf09e857ef7c39e8ce337171d04cca1d72 100644 (file)
@@ -3627,13 +3627,13 @@ out_unlock:
        return ret;
 }
 
-ssize_t btrfs_dedupe_file_range(struct file *src_file, u64 loff, u64 olen,
-                               struct file *dst_file, u64 dst_loff)
+int btrfs_dedupe_file_range(struct file *src_file, loff_t src_loff,
+                           struct file *dst_file, loff_t dst_loff,
+                           u64 olen)
 {
        struct inode *src = file_inode(src_file);
        struct inode *dst = file_inode(dst_file);
        u64 bs = BTRFS_I(src)->root->fs_info->sb->s_blocksize;
-       ssize_t res;
 
        if (WARN_ON_ONCE(bs < PAGE_SIZE)) {
                /*
@@ -3644,10 +3644,7 @@ ssize_t btrfs_dedupe_file_range(struct file *src_file, u64 loff, u64 olen,
                return -EINVAL;
        }
 
-       res = btrfs_extent_same(src, loff, olen, dst, dst_loff);
-       if (res)
-               return res;
-       return olen;
+       return btrfs_extent_same(src, src_loff, olen, dst, dst_loff);
 }
 
 static int clone_finish_inode_update(struct btrfs_trans_handle *trans,