btrfs: remove unused sectorsize member
authorNikolay Borisov <nborisov@suse.com>
Wed, 28 Jun 2017 08:05:22 +0000 (11:05 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 16 Aug 2017 12:19:53 +0000 (14:19 +0200)
The sectorsize member of btrfs_block_group_cache is unused. So remove it, this
reduces the number of holes in the struct.

With patch:
/* size: 856, cachelines: 14, members: 40 */
/* sum members: 837, holes: 4, sum holes: 19 */
/* bit holes: 1, sum bit holes: 29 bits */
/* last cacheline: 24 bytes */

Without patch:
/* size: 864, cachelines: 14, members: 41 */
/* sum members: 841, holes: 5, sum holes: 23 */
/* bit holes: 1, sum bit holes: 29 bits */
/* last cacheline: 32 bytes */

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/tests/btrfs-tests.c
fs/btrfs/tests/free-space-tree-tests.c

index 3f3eb7b17cac5c84be5883a5577b547eb8847b90..5894910409504509bb002e11adba144b0b5d54a4 100644 (file)
@@ -558,7 +558,6 @@ struct btrfs_block_group_cache {
        u64 bytes_super;
        u64 flags;
        u64 cache_generation;
-       u32 sectorsize;
 
        /*
         * If the free space extent count exceeds this number, convert the block
index e3b0b4196d3df173fd52d62076396f21029f073d..6d04563585e618defe5ef8554a38d3ed70914ef3 100644 (file)
@@ -9952,7 +9952,6 @@ btrfs_create_block_group_cache(struct btrfs_fs_info *fs_info,
        cache->key.offset = size;
        cache->key.type = BTRFS_BLOCK_GROUP_ITEM_KEY;
 
-       cache->sectorsize = fs_info->sectorsize;
        cache->fs_info = fs_info;
        cache->full_stripe_len = btrfs_full_stripe_len(fs_info,
                                                       &fs_info->mapping_tree,
index b18ab8f327a53dd10b09bee6169f34ecff5eb809..d3f25376a0f86d255fa2db7999ff8da612422da9 100644 (file)
@@ -211,7 +211,6 @@ btrfs_alloc_dummy_block_group(struct btrfs_fs_info *fs_info,
        cache->key.objectid = 0;
        cache->key.offset = length;
        cache->key.type = BTRFS_BLOCK_GROUP_ITEM_KEY;
-       cache->sectorsize = fs_info->sectorsize;
        cache->full_stripe_len = fs_info->sectorsize;
        cache->fs_info = fs_info;
 
index b29954c016738ad05c40ebefb2ba34f4cb8d75ca..1458bb0ea124a3784403adf6196e9bd146098b0d 100644 (file)
@@ -81,7 +81,7 @@ static int __check_free_space_extents(struct btrfs_trans_handle *trans,
                                        i++;
                                }
                                prev_bit = bit;
-                               offset += cache->sectorsize;
+                               offset += fs_info->sectorsize;
                        }
                }
                if (prev_bit == 1) {