From 5740c99e9d30b81fcc478797e7215c61e241f44e Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 6 Jul 2018 23:57:03 +0200 Subject: vfs: dedupe: return int Signed-off-by: Miklos Szeredi --- fs/btrfs/ctree.h | 4 ++-- fs/btrfs/ioctl.c | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'fs/btrfs') diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 118346aceea9..1c7c13334423 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3247,8 +3247,8 @@ void btrfs_get_block_group_info(struct list_head *groups_list, struct btrfs_ioctl_space_info *space); void btrfs_update_ioctl_balance_args(struct btrfs_fs_info *fs_info, struct btrfs_ioctl_balance_args *bargs); -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, u64 loff, u64 olen, + struct file *dst_file, u64 dst_loff); /* file.c */ int __init btrfs_auto_defrag_init(void); diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index c2837a32d689..94dc8e6c44ce 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3600,13 +3600,12 @@ out_free: 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, u64 loff, u64 olen, + struct file *dst_file, u64 dst_loff) { 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)) { /* @@ -3617,10 +3616,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, loff, olen, dst, dst_loff); } static int clone_finish_inode_update(struct btrfs_trans_handle *trans, -- cgit v1.2.1