diff options
author | David Sterba <dsterba@suse.com> | 2020-07-02 11:27:30 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-12-08 15:53:59 +0100 |
commit | 223486c27b369a10ceb6180c40d7aa354e903446 (patch) | |
tree | 26f5d18a30be1e251900158f0af6e65611f56369 /fs/btrfs/compression.c | |
parent | 55fc29bed8ddb4c3848ecf8cf7133e34c946f223 (diff) |
btrfs: switch cached fs_info::csum_size from u16 to u32
The fs_info value is 32bit, switch also the local u16 variables. This
leads to a better assembly code generated due to movzwl.
This simple change will shave some bytes on x86_64 and release config:
text data bss dec hex filename
1090000 17980 14912 1122892 11224c pre/btrfs.ko
1089794 17980 14912 1122686 11217e post/btrfs.ko
DELTA: -206
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r-- | fs/btrfs/compression.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 00bbd859f31b..b2bb4681975e 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -131,8 +131,7 @@ static int btrfs_decompress_bio(struct compressed_bio *cb); static inline int compressed_bio_size(struct btrfs_fs_info *fs_info, unsigned long disk_size) { - const u16 csum_size = fs_info->csum_size; - + const u32 csum_size = fs_info->csum_size; return sizeof(struct compressed_bio) + (DIV_ROUND_UP(disk_size, fs_info->sectorsize)) * csum_size; } @@ -142,7 +141,7 @@ static int check_compressed_csum(struct btrfs_inode *inode, struct bio *bio, { struct btrfs_fs_info *fs_info = inode->root->fs_info; SHASH_DESC_ON_STACK(shash, fs_info->csum_shash); - const u16 csum_size = fs_info->csum_size; + const u32 csum_size = fs_info->csum_size; struct page *page; unsigned long i; char *kaddr; @@ -628,7 +627,7 @@ blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, struct extent_map *em; blk_status_t ret = BLK_STS_RESOURCE; int faili = 0; - const u16 csum_size = fs_info->csum_size; + const u32 csum_size = fs_info->csum_size; u8 *sums; em_tree = &BTRFS_I(inode)->extent_tree; |