]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: place all boolean fields together in struct find_free_extent_ctl
authorFilipe Manana <fdmanana@suse.com>
Mon, 17 Nov 2025 12:15:09 +0000 (12:15 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:42:26 +0000 (22:42 +0100)
Move the 'retry_uncached' and 'hint' fields close to the other boolean
fields so that we remove a hole from the structure and reduce its size
from 136 bytes down to 128 bytes. Currently this structure is only
allocated in the stack of btrfs_reserve_extent().

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.h

index f96a300a2db4a84a940e5c28c81f3564e8dea929..71bb8109c969c41ebcbfb7632603a58aa2a06e23 100644 (file)
@@ -49,6 +49,16 @@ struct find_free_extent_ctl {
        /* Allocation is called for data relocation */
        bool for_data_reloc;
 
+       /*
+        * Set to true if we're retrying the allocation on this block group
+        * after waiting for caching progress, this is so that we retry only
+        * once before moving on to another block group.
+        */
+       bool retry_uncached;
+
+       /* Whether or not the allocator is currently following a hint. */
+       bool hinted;
+
        /* RAID index, converted from flags */
        int index;
 
@@ -57,13 +67,6 @@ struct find_free_extent_ctl {
         */
        int loop;
 
-       /*
-        * Set to true if we're retrying the allocation on this block group
-        * after waiting for caching progress, this is so that we retry only
-        * once before moving on to another block group.
-        */
-       bool retry_uncached;
-
        /* If current block group is cached */
        int cached;
 
@@ -82,9 +85,6 @@ struct find_free_extent_ctl {
        /* Allocation policy */
        enum btrfs_extent_allocation_policy policy;
 
-       /* Whether or not the allocator is currently following a hint */
-       bool hinted;
-
        /* Size class of block groups to prefer in early loops */
        enum btrfs_block_group_size_class size_class;
 };