From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/3] btrfs: remove superfluous metadata check at btrfs_lookup_extent_info()
Date: Wed, 19 Jun 2024 12:06:42 +0100 [thread overview]
Message-ID: <faa3bc9b7781d5f590e6a959a5acfa8fdcd03365.1718794792.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1718794792.git.fdmanana@suse.com>
From: Filipe Manana <fdmanana@suse.com>
If we didn't found an extent item with the initial btrfs_search_slot()
call, it's pointless to test if the "metadata" variable is "true", because
right after we check if the key type is BTRFS_METADATA_ITEM_KEY and that
is the case only when "metadata" is set to "true". So remove the redundant
check.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
fs/btrfs/extent-tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 21d123d392c0..a14d2a74d7fd 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -139,7 +139,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
if (ret < 0)
goto out_free;
- if (ret > 0 && metadata && key.type == BTRFS_METADATA_ITEM_KEY) {
+ if (ret > 0 && key.type == BTRFS_METADATA_ITEM_KEY) {
if (path->slots[0]) {
path->slots[0]--;
btrfs_item_key_to_cpu(path->nodes[0], &key,
--
2.43.0
next prev parent reply other threads:[~2024-06-19 11:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 11:06 [PATCH 0/3] btrfs: some cleanups for btrfs_lookup_extent_info() fdmanana
2024-06-19 11:06 ` fdmanana [this message]
2024-06-19 11:06 ` [PATCH 2/3] btrfs: reduce nesting for extent processing at btrfs_lookup_extent_info() fdmanana
2024-06-19 11:06 ` [PATCH 3/3] btrfs: don't BUG_ON() when 0 reference count " fdmanana
2024-06-19 23:24 ` [PATCH 0/3] btrfs: some cleanups for btrfs_lookup_extent_info() Qu Wenruo
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=faa3bc9b7781d5f590e6a959a5acfa8fdcd03365.1718794792.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