Skip to content

Commit 9577b96

Browse files
fdmananakdave
authored andcommitted
btrfs: remove pointless out label from remove_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 <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 8bf3db7 commit 9577b96

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

fs/btrfs/free-space-tree.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ static int remove_free_space_extent(struct btrfs_trans_handle *trans,
727727

728728
ret = btrfs_search_prev_slot(trans, root, &key, path, -1, 1);
729729
if (ret)
730-
goto out;
730+
return ret;
731731

732732
btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
733733

@@ -759,7 +759,7 @@ static int remove_free_space_extent(struct btrfs_trans_handle *trans,
759759
/* Delete the existing key (cases 1-4). */
760760
ret = btrfs_del_item(trans, root, path);
761761
if (ret)
762-
goto out;
762+
return ret;
763763

764764
/* Add a key for leftovers at the beginning (cases 3 and 4). */
765765
if (start > found_start) {
@@ -770,7 +770,7 @@ static int remove_free_space_extent(struct btrfs_trans_handle *trans,
770770
btrfs_release_path(path);
771771
ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
772772
if (ret)
773-
goto out;
773+
return ret;
774774
new_extents++;
775775
}
776776

@@ -783,16 +783,12 @@ static int remove_free_space_extent(struct btrfs_trans_handle *trans,
783783
btrfs_release_path(path);
784784
ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
785785
if (ret)
786-
goto out;
786+
return ret;
787787
new_extents++;
788788
}
789789

790790
btrfs_release_path(path);
791-
ret = update_free_space_extent_count(trans, block_group, path,
792-
new_extents);
793-
794-
out:
795-
return ret;
791+
return update_free_space_extent_count(trans, block_group, path, new_extents);
796792
}
797793

798794
EXPORT_FOR_TESTS

0 commit comments

Comments
 (0)