btrfs: remove out label in btrfs_init_space_info()
authorFilipe Manana <fdmanana@suse.com>
Tue, 20 Jan 2026 20:06:57 +0000 (20:06 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:56:23 +0000 (07:56 +0100)
There is no point in having the label since all it does is return the
value in the 'ret' variable. Instead make every goto return directly
and remove the label.

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/space-info.c

index bc49324..bb5aac7 100644 (file)
@@ -329,7 +329,7 @@ int btrfs_init_space_info(struct btrfs_fs_info *fs_info)
        struct btrfs_super_block *disk_super;
        u64 features;
        u64 flags;
-       int mixed = 0;
+       bool mixed = false;
        int ret;
 
        disk_super = fs_info->super_copy;
@@ -338,28 +338,28 @@ int btrfs_init_space_info(struct btrfs_fs_info *fs_info)
 
        features = btrfs_super_incompat_flags(disk_super);
        if (features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS)
-               mixed = 1;
+               mixed = true;
 
        flags = BTRFS_BLOCK_GROUP_SYSTEM;
        ret = create_space_info(fs_info, flags);
        if (ret)
-               goto out;
+               return ret;
 
        if (mixed) {
                flags = BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA;
                ret = create_space_info(fs_info, flags);
                if (ret)
-                       goto out;
+                       return ret;
        } else {
                flags = BTRFS_BLOCK_GROUP_METADATA;
                ret = create_space_info(fs_info, flags);
                if (ret)
-                       goto out;
+                       return ret;
 
                flags = BTRFS_BLOCK_GROUP_DATA;
                ret = create_space_info(fs_info, flags);
                if (ret)
-                       goto out;
+                       return ret;
        }
 
        if (features & BTRFS_FEATURE_INCOMPAT_REMAP_TREE) {
@@ -367,7 +367,6 @@ int btrfs_init_space_info(struct btrfs_fs_info *fs_info)
                ret = create_space_info(fs_info, flags);
        }
 
-out:
        return ret;
 }