Skip to content

Commit 753b146

Browse files
fdmananakdave
authored andcommitted
btrfs: remove pointless out label from add_free_space_extent()
All we do under the label is to return, so there's no point in having it, just return directly whenever we get an error. Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 9577b96 commit 753b146

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

fs/btrfs/free-space-tree.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static int add_free_space_extent(struct btrfs_trans_handle *trans,
900900

901901
ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
902902
if (ret)
903-
goto out;
903+
return ret;
904904

905905
btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
906906

@@ -923,7 +923,7 @@ static int add_free_space_extent(struct btrfs_trans_handle *trans,
923923
if (found_end == start) {
924924
ret = btrfs_del_item(trans, root, path);
925925
if (ret)
926-
goto out;
926+
return ret;
927927
new_key.objectid = found_start;
928928
new_key.offset += key.offset;
929929
new_extents--;
@@ -940,7 +940,7 @@ static int add_free_space_extent(struct btrfs_trans_handle *trans,
940940

941941
ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
942942
if (ret)
943-
goto out;
943+
return ret;
944944

945945
btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
946946

@@ -964,7 +964,7 @@ static int add_free_space_extent(struct btrfs_trans_handle *trans,
964964
if (found_start == end) {
965965
ret = btrfs_del_item(trans, root, path);
966966
if (ret)
967-
goto out;
967+
return ret;
968968
new_key.offset += key.offset;
969969
new_extents--;
970970
}
@@ -974,14 +974,10 @@ static int add_free_space_extent(struct btrfs_trans_handle *trans,
974974
/* Insert the new key (cases 1-4). */
975975
ret = btrfs_insert_empty_item(trans, root, path, &new_key, 0);
976976
if (ret)
977-
goto out;
977+
return ret;
978978

979979
btrfs_release_path(path);
980-
ret = update_free_space_extent_count(trans, block_group, path,
981-
new_extents);
982-
983-
out:
984-
return ret;
980+
return update_free_space_extent_count(trans, block_group, path, new_extents);
985981
}
986982

987983
EXPORT_FOR_TESTS

0 commit comments

Comments
 (0)