summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2019-01-08 11:43:18 +0000
committerDavid Sterba <dsterba@suse.com>2019-02-04 17:21:50 +0100
commit869d7e3b085218e13b51d16cd410884448a9a553 (patch)
tree7f5a0ba2ed2a07b95f8d40a199add96222dd255e
parent95aa1ad50409f5cb177c980062fbc0629460f57f (diff)
downloadlinux-next-869d7e3b085218e13b51d16cd410884448a9a553.tar.gz
Btrfs: remove redundant check for swapfiles when reflinking
Checking if either of the inodes corresponds to a swapfile is already performed by generic_remap_file_range_prep(), so we do not need to do it in the btrfs clone and deduplication functions. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/ioctl.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 4b5619127435..816fa7dce79f 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3285,9 +3285,6 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
(BTRFS_I(dst)->flags & BTRFS_INODE_NODATASUM))
return -EINVAL;
- if (IS_SWAPFILE(src) || IS_SWAPFILE(dst))
- return -ETXTBSY;
-
tail_len = olen % BTRFS_MAX_DEDUPE_LEN;
chunk_count = div_u64(olen, BTRFS_MAX_DEDUPE_LEN);
@@ -3910,9 +3907,6 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src,
(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM))
return -EINVAL;
- if (IS_SWAPFILE(src) || IS_SWAPFILE(inode))
- return -ETXTBSY;
-
/*
* VFS's generic_remap_file_range_prep() protects us from cloning the
* eof block into the middle of a file, which would result in corruption