diff options
author | David Sterba <dsterba@suse.com> | 2020-06-30 03:01:31 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-12-08 17:53:59 +0300 |
commit | 55fc29bed8ddb4c3848ecf8cf7133e34c946f223 (patch) | |
tree | c7174086f876963be22ca15e63e05560378d4518 /fs/btrfs/ordered-data.h | |
parent | fe5ecbe818de38774895305e1f2d48972f1b745f (diff) | |
download | linux-55fc29bed8ddb4c3848ecf8cf7133e34c946f223.tar.xz |
btrfs: use cached value of fs_info::csum_size everywhere
btrfs_get_16 shows up in the system performance profiles (helper to read
16bit values from on-disk structures). This is partially because of the
checksum size that's frequently read along with data reads/writes, other
u16 uses are from item size or directory entries.
Replace all calls to btrfs_super_csum_size by the cached value from
fs_info.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ordered-data.h')
-rw-r--r-- | fs/btrfs/ordered-data.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h index c3a2325e64a4..4662fd8ca546 100644 --- a/fs/btrfs/ordered-data.h +++ b/fs/btrfs/ordered-data.h @@ -137,7 +137,7 @@ static inline int btrfs_ordered_sum_size(struct btrfs_fs_info *fs_info, unsigned long bytes) { int num_sectors = (int)DIV_ROUND_UP(bytes, fs_info->sectorsize); - int csum_size = btrfs_super_csum_size(fs_info->super_copy); + const u16 csum_size = fs_info->csum_size; return sizeof(struct btrfs_ordered_sum) + num_sectors * csum_size; } |