summaryrefslogtreecommitdiff
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2020-07-02 11:10:18 +0200
committerDavid Sterba <dsterba@suse.com>2020-12-08 15:53:58 +0100
commit22b6331d961712ac2735423e5a6c04e9d0fd7897 (patch)
treefa75be6649cd24450abcd3d9367a15bb0560e01d /fs/btrfs/disk-io.c
parent265fdfa6ce0a79df3b880bbf39d9a00a0435687f (diff)
downloadlinux-next-22b6331d961712ac2735423e5a6c04e9d0fd7897.tar.gz
btrfs: store precalculated csum_size in fs_info
In many places we need the checksum size and it is inefficient to read it from the raw superblock. Store the value into fs_info, actual use will be in followup patches. The size is u32 as it allows to generate better assembly than with u16. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 25889a2362e2..475bd197c482 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3080,6 +3080,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
fs_info->nodesize = nodesize;
fs_info->sectorsize = sectorsize;
fs_info->sectorsize_bits = ilog2(sectorsize);
+ fs_info->csum_size = btrfs_super_csum_size(disk_super);
fs_info->stripesize = stripesize;
/*