aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-06-11 12:06:57 +0100
committerDavid Sterba <dsterba@suse.com>2025-07-21 23:58:01 +0200
commit61b43a937418cd769818159d8cc007eb888ea195 (patch)
tree9c6b7fcb3d93b667c417974cb4583a5c508d9e43
parentbtrfs: tree-log: add and rename extent bits for dirty_log_pages tree (diff)
downloadwireguard-linux-61b43a937418cd769818159d8cc007eb888ea195.tar.xz
wireguard-linux-61b43a937418cd769818159d8cc007eb888ea195.zip
btrfs: remove pointless out label from add_new_free_space_info()
We can just return directly if btrfs_insert_empty_item() fails, there is no need to release the path before returning, as all callers (or upper in the call chain) will free the path if they get an error from the call to add_new_free_space_info(), which is also a common pattern everywhere in btrfs. Finally there's no need to set 'ret' to 0 if the call to btrfs_insert_empty_item() didn't fail, since 'ret' is already 0. 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>
-rw-r--r--fs/btrfs/free-space-tree.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
index f03f3610b713..6418b3b5d16a 100644
--- a/fs/btrfs/free-space-tree.c
+++ b/fs/btrfs/free-space-tree.c
@@ -82,18 +82,15 @@ static int add_new_free_space_info(struct btrfs_trans_handle *trans,
ret = btrfs_insert_empty_item(trans, root, path, &key, sizeof(*info));
if (ret)
- goto out;
+ return ret;
leaf = path->nodes[0];
info = btrfs_item_ptr(leaf, path->slots[0],
struct btrfs_free_space_info);
btrfs_set_free_space_extent_count(leaf, info, 0);
btrfs_set_free_space_flags(leaf, info, 0);
-
- ret = 0;
-out:
btrfs_release_path(path);
- return ret;
+ return 0;
}
EXPORT_FOR_TESTS