]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove out label in btrfs_csum_file_blocks()
authorFilipe Manana <fdmanana@suse.com>
Tue, 20 Jan 2026 20:02:51 +0000 (20:02 +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/file-item.c

index 568f0e0ebdf63d49b98639ffca17602e01d5d7fa..7bd715442f3ee64952173e81009e43a73f10c62e 100644 (file)
@@ -1134,7 +1134,7 @@ again:
        }
        ret = PTR_ERR(item);
        if (ret != -EFBIG && ret != -ENOENT)
-               goto out;
+               return ret;
 
        if (ret == -EFBIG) {
                u32 item_size;
@@ -1150,7 +1150,7 @@ again:
                /* We didn't find a csum item, insert one. */
                ret = find_next_csum_offset(root, path, &next_offset);
                if (ret < 0)
-                       goto out;
+                       return ret;
                found_next = 1;
                goto insert;
        }
@@ -1178,7 +1178,7 @@ again:
                                csum_size, 1);
        path->search_for_extension = false;
        if (ret < 0)
-               goto out;
+               return ret;
 
        if (ret > 0) {
                if (path->slots[0] == 0)
@@ -1234,14 +1234,14 @@ extend_csum:
                            btrfs_header_nritems(path->nodes[0])) {
                                ret = find_next_csum_offset(root, path, &next_offset);
                                if (ret < 0)
-                                       goto out;
+                                       return ret;
                                found_next = 1;
                                goto insert;
                        }
 
                        ret = find_next_csum_offset(root, path, &next_offset);
                        if (ret < 0)
-                               goto out;
+                               return ret;
 
                        tmp = (next_offset - bytenr) >> fs_info->sectorsize_bits;
                        if (tmp <= INT_MAX)
@@ -1282,7 +1282,7 @@ insert:
        ret = btrfs_insert_empty_item(trans, root, path, &file_key,
                                      ins_size);
        if (ret < 0)
-               goto out;
+               return ret;
        leaf = path->nodes[0];
 csum:
        item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item);
@@ -1307,8 +1307,8 @@ found:
                cond_resched();
                goto again;
        }
-out:
-       return ret;
+
+       return 0;
 }
 
 void btrfs_extent_item_to_extent_map(struct btrfs_inode *inode,