summaryrefslogtreecommitdiff
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-10-16 11:29:14 -0400
committerDavid Sterba <dsterba@suse.com>2020-12-08 15:53:39 +0100
commit334c16d82cfe180f7b262a6f8ae2d9379f032b18 (patch)
treefcb81b2facd3c4c1d68a0ef34a6200d091b3e210 /fs/btrfs/file-item.c
parentd70bf7484f728704454c0566814458bf6d6c7cf3 (diff)
btrfs: push the NODATASUM check into btrfs_lookup_bio_sums
When we move to being able to handle NULL csum_roots it'll be cleaner to just check in btrfs_lookup_bio_sums instead of at all of the caller locations, so push the NODATASUM check into it as well so it's unified. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 8f4f2bd6d9b9..8083d71d6af6 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -272,6 +272,9 @@ blk_status_t btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio,
int count = 0;
u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
+ if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)
+ return BLK_STS_OK;
+
path = btrfs_alloc_path();
if (!path)
return BLK_STS_RESOURCE;