linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 05/16] btrfs: remove pointless out label from modify_free_space_bitmap()
Date: Tue, 17 Jun 2025 17:13:00 +0100	[thread overview]
Message-ID: <df2d3a94e098fcde8e43a5d692ae123666b10b05.1750075579.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1750075579.git.fdmanana@suse.com>

From: Filipe Manana <fdmanana@suse.com>

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.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/free-space-tree.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
index 4cd1f46cd694..a4909393840a 100644
--- a/fs/btrfs/free-space-tree.c
+++ b/fs/btrfs/free-space-tree.c
@@ -630,7 +630,7 @@ static int modify_free_space_bitmap(struct btrfs_trans_handle *trans,
 
 		ret = btrfs_search_prev_slot(trans, root, &key, path, 0, 1);
 		if (ret)
-			goto out;
+			return ret;
 
 		prev_bit_set = free_space_test_bit(block_group, path, prev_block);
 
@@ -639,7 +639,7 @@ static int modify_free_space_bitmap(struct btrfs_trans_handle *trans,
 		if (start >= key.objectid + key.offset) {
 			ret = free_space_next_bitmap(trans, root, path);
 			if (ret)
-				goto out;
+				return ret;
 		}
 	} else {
 		key.objectid = start;
@@ -648,7 +648,7 @@ static int modify_free_space_bitmap(struct btrfs_trans_handle *trans,
 
 		ret = btrfs_search_prev_slot(trans, root, &key, path, 0, 1);
 		if (ret)
-			goto out;
+			return ret;
 	}
 
 	/*
@@ -664,7 +664,7 @@ static int modify_free_space_bitmap(struct btrfs_trans_handle *trans,
 			break;
 		ret = free_space_next_bitmap(trans, root, path);
 		if (ret)
-			goto out;
+			return ret;
 	}
 
 	/*
@@ -677,7 +677,7 @@ static int modify_free_space_bitmap(struct btrfs_trans_handle *trans,
 		if (end >= key.objectid + key.offset) {
 			ret = free_space_next_bitmap(trans, root, path);
 			if (ret)
-				goto out;
+				return ret;
 		}
 
 		next_bit_set = free_space_test_bit(block_group, path, end);
@@ -706,11 +706,7 @@ static int modify_free_space_bitmap(struct btrfs_trans_handle *trans,
 	}
 
 	btrfs_release_path(path);
-	ret = update_free_space_extent_count(trans, block_group, path,
-					     new_extents);
-
-out:
-	return ret;
+	return update_free_space_extent_count(trans, block_group, path, new_extents);
 }
 
 static int remove_free_space_extent(struct btrfs_trans_handle *trans,
-- 
2.47.2


  parent reply	other threads:[~2025-06-17 16:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 16:12 [PATCH 00/16] btrfs: free space tree optimization and cleanups fdmanana
2025-06-17 16:12 ` [PATCH 01/16] btrfs: remove pointless out label from add_new_free_space_info() fdmanana
2025-06-17 16:12 ` [PATCH 02/16] btrfs: remove pointless out label from update_free_space_extent_count() fdmanana
2025-06-17 16:12 ` [PATCH 03/16] btrfs: make extent_buffer_test_bit() return a boolean instead fdmanana
2025-06-17 16:12 ` [PATCH 04/16] btrfs: make free_space_test_bit() " fdmanana
2025-06-17 16:13 ` fdmanana [this message]
2025-06-17 16:13 ` [PATCH 06/16] btrfs: remove pointless out label from remove_free_space_extent() fdmanana
2025-06-17 16:13 ` [PATCH 07/16] btrfs: remove pointless out label from add_free_space_extent() fdmanana
2025-06-17 16:13 ` [PATCH 08/16] btrfs: remove pointless out label from load_free_space_bitmaps() fdmanana
2025-06-17 16:13 ` [PATCH 09/16] btrfs: remove pointless out label from load_free_space_extents() fdmanana
2025-06-17 16:13 ` [PATCH 10/16] btrfs: add btrfs prefix to free space tree exported functions fdmanana
2025-06-17 16:13 ` [PATCH 11/16] btrfs: rename free_space_set_bits() and make it less confusing fdmanana
2025-06-17 16:13 ` [PATCH 12/16] btrfs: turn remove argument of modify_free_space_bitmap() to boolean fdmanana
2025-06-17 16:13 ` [PATCH 13/16] btrfs: avoid double slot decrement at btrfs_convert_free_space_to_extents() fdmanana
2025-06-17 16:13 ` [PATCH 14/16] btrfs: use fs_info from local variable in btrfs_convert_free_space_to_extents() fdmanana
2025-06-17 16:13 ` [PATCH 15/16] btrfs: add and use helper to determine if using bitmaps in free space tree fdmanana
2025-06-17 21:41   ` Boris Burkov
2025-06-17 16:13 ` [PATCH 16/16] btrfs: cache if we are using free space bitmaps for a block group fdmanana
2025-06-17 21:52   ` Boris Burkov
2025-06-17 21:59     ` Filipe Manana
2025-06-17 22:12       ` Boris Burkov
2025-06-18 11:50 ` [PATCH 00/16] btrfs: free space tree optimization and cleanups David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df2d3a94e098fcde8e43a5d692ae123666b10b05.1750075579.git.fdmanana@suse.com \
    --to=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).