]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: use the enums instead of int type in struct btrfs_block_group fields
authorFilipe Manana <fdmanana@suse.com>
Mon, 20 Apr 2026 10:44:07 +0000 (11:44 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Jun 2026 13:53:30 +0000 (15:53 +0200)
The 'disk_cache_state' and 'cached' fields are defined with an int type
but all the values we assigned to them come from the enums
btrfs_disk_cache_state and btrfs_caching_type. So change the type in the
btrfs_block_group structure from int to these enums - in practice an enum
is an int, so this is more for readability and clarity.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Sun YangKai <sunk67188@gmail.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/block-group.h

index 60a3b1c0a8abd787d0440c8d0a5c6de4198dd027..790c2d467af57042c6d5245d4822bf04bc043e23 100644 (file)
@@ -171,10 +171,10 @@ struct btrfs_block_group {
        unsigned long full_stripe_len;
        unsigned long runtime_flags;
 
-       int disk_cache_state;
+       enum btrfs_disk_cache_state disk_cache_state;
 
        /* Cache tracking stuff */
-       int cached;
+       enum btrfs_caching_type cached;
        struct btrfs_caching_control *caching_ctl;
 
        struct btrfs_space_info *space_info;