btrfs: remove out label in load_extent_tree_free()
authorFilipe Manana <fdmanana@suse.com>
Tue, 20 Jan 2026 19:59:13 +0000 (19:59 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:56:22 +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/block-group.c

index 28aa878..3a05212 100644 (file)
@@ -766,7 +766,7 @@ static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl)
 next:
        ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0);
        if (ret < 0)
-               goto out;
+               return ret;
 
        leaf = path->nodes[0];
        nritems = btrfs_header_nritems(leaf);
@@ -797,7 +797,7 @@ next:
 
                        ret = btrfs_next_leaf(extent_root, path);
                        if (ret < 0)
-                               goto out;
+                               return ret;
                        if (ret)
                                break;
                        leaf = path->nodes[0];
@@ -828,7 +828,7 @@ next:
                        ret = btrfs_add_new_free_space(block_group, last,
                                                       key.objectid, &space_added);
                        if (ret)
-                               goto out;
+                               return ret;
                        total_found += space_added;
                        if (key.type == BTRFS_METADATA_ITEM_KEY)
                                last = key.objectid +
@@ -847,9 +847,7 @@ next:
                path->slots[0]++;
        }
 
-       ret = btrfs_add_new_free_space(block_group, last, block_group_end, NULL);
-out:
-       return ret;
+       return btrfs_add_new_free_space(block_group, last, block_group_end, NULL);
 }
 
 static inline void btrfs_free_excluded_extents(const struct btrfs_block_group *bg)