]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove pointless label and goto from unpin_extent_range()
authorFilipe Manana <fdmanana@suse.com>
Mon, 20 Oct 2025 15:08:50 +0000 (16:08 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:16:23 +0000 (22:16 +0100)
There's no need to have an 'out' label and jump there in case we can
not find a block group. We can simply return directly since there are no
resources to release, removing the need for the label and the 'ret'
variable.

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.c

index d839d8d3241252ae8d24c4cf648475efe095987b..f981ff72fb98133f3601cf1243ef9caf776cd0fa 100644 (file)
@@ -2747,7 +2747,6 @@ static int unpin_extent_range(struct btrfs_fs_info *fs_info,
        struct btrfs_free_cluster *cluster = NULL;
        u64 total_unpinned = 0;
        u64 empty_cluster = 0;
-       int ret = 0;
 
        while (start <= end) {
                u64 len;
@@ -2761,8 +2760,7 @@ static int unpin_extent_range(struct btrfs_fs_info *fs_info,
                        cache = btrfs_lookup_block_group(fs_info, start);
                        if (unlikely(cache == NULL)) {
                                /* Logic error, something removed the block group. */
-                               ret = -EUCLEAN;
-                               goto out;
+                               return -EUCLEAN;
                        }
 
                        cluster = fetch_cluster_info(fs_info,
@@ -2816,8 +2814,8 @@ static int unpin_extent_range(struct btrfs_fs_info *fs_info,
 
        if (cache)
                btrfs_put_block_group(cache);
-out:
-       return ret;
+
+       return 0;
 }
 
 int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans)