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/inode.c | |
parent | 55fc29bed8ddb4c3848ecf8cf7133e34c946f223 (diff) | |
download | lwn-223486c27b369a10ceb6180c40d7aa354e903446.tar.gz lwn-223486c27b369a10ceb6180c40d7aa354e903446.zip |
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/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 358d900d0cf5..d1915049d7e7 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2906,7 +2906,7 @@ static int check_data_csum(struct inode *inode, struct btrfs_io_bio *io_bio, SHASH_DESC_ON_STACK(shash, fs_info->csum_shash); char *kaddr; u32 len = fs_info->sectorsize; - const u16 csum_size = fs_info->csum_size; + const u32 csum_size = fs_info->csum_size; u8 *csum_expected; u8 csum[BTRFS_CSUM_SIZE]; @@ -7850,11 +7850,10 @@ static struct btrfs_dio_private *btrfs_create_dio_private(struct bio *dio_bio, dip_size = sizeof(*dip); if (!write && csum) { struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); - const u16 csum_size = fs_info->csum_size; size_t nblocks; nblocks = dio_bio->bi_iter.bi_size >> fs_info->sectorsize_bits; - dip_size += csum_size * nblocks; + dip_size += fs_info->csum_size * nblocks; } dip = kzalloc(dip_size, GFP_NOFS); |