public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Sun YangKai <sunk67188@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: Sun YangKai <sunk67188@gmail.com>
Subject: [PATCH 2/3] btrfs: send: drop unnecessary return_any search in get_last_extent()
Date: Sun,  8 Feb 2026 11:38:29 +0800	[thread overview]
Message-ID: <20260208033942.31650-1-sunk67188@gmail.com> (raw)
In-Reply-To: <20260208032705.27040-3-sunk67188@gmail.com>

There must always be a previous item before an extent data item, at
least the inode_item. Because of this, setting @return_any in
btrfs_search_slot_for_read() is unnecessary.

Signed-off-by: Sun YangKai <sunk67188@gmail.com>
---
 fs/btrfs/send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index d8127a7120c2..5b551f811bf6 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -6320,7 +6320,7 @@ static int get_last_extent(struct send_ctx *sctx, u64 offset)
 	key.objectid = sctx->cur_ino;
 	key.type = BTRFS_EXTENT_DATA_KEY;
 	key.offset = offset;
-	ret = btrfs_search_slot_for_read(root, &key, path, 0, 1);
+	ret = btrfs_search_slot_for_read(root, &key, path, 0, 0);
 	if (ret < 0)
 		return ret;
 	ret = 0;
-- 
2.52.0


  parent reply	other threads:[~2026-02-08  3:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-08  3:19 [PATCH 0/3] btrfs: remove unused return_any parameter from btrfs_search_slot_for_read() Sun YangKai
2026-02-08  3:19 ` [PATCH 1/3] btrfs: qgroup: drop pointless return_any fallback when reading qgroup config Sun YangKai
2026-02-08  3:38 ` Sun YangKai [this message]
2026-02-08  3:40 ` [PATCH 3/3] btrfs: simplify btrfs_search_slot_for_read() by removing return_any parameter Sun YangKai

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=20260208033942.31650-1-sunk67188@gmail.com \
    --to=sunk67188@gmail.com \
    --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