From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 3/4] btrfs: make lock_extent_buffer_for_io() to be subpage compatible
Date: Tue, 6 Apr 2021 08:36:02 +0800 [thread overview]
Message-ID: <20210406003603.64381-4-wqu@suse.com> (raw)
In-Reply-To: <20210406003603.64381-1-wqu@suse.com>
For subpage metadata, we don't use page locking at all.
So just skip the page locking part for subpage.
All the remaining routine can be reused.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/extent_io.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 9567e7b2b6cf..db40bc701a03 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3967,7 +3967,13 @@ static noinline_for_stack int lock_extent_buffer_for_io(struct extent_buffer *eb
btrfs_tree_unlock(eb);
- if (!ret)
+ /*
+ * Either we don't need to submit any tree block, or we're submitting
+ * subpage.
+ * Subpage metadata doesn't use page locking at all, so we can skip
+ * the page locking.
+ */
+ if (!ret || fs_info->sectorsize < PAGE_SIZE)
return ret;
num_pages = num_extent_pages(eb);
--
2.31.1
next prev parent reply other threads:[~2021-04-06 0:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 0:35 [PATCH 0/4] btrfs: the missing 4 patches to implement metadata write path Qu Wenruo
2021-04-06 0:36 ` [PATCH 1/4] btrfs: introduce end_bio_subpage_eb_writepage() function Qu Wenruo
2021-04-06 0:36 ` [PATCH 2/4] btrfs: introduce write_one_subpage_eb() function Qu Wenruo
2021-04-06 0:36 ` Qu Wenruo [this message]
2021-04-06 0:36 ` [PATCH 4/4] btrfs: introduce submit_eb_subpage() to submit a subpage metadata page Qu Wenruo
2021-04-23 11:29 ` [PATCH 0/4] btrfs: the missing 4 patches to implement metadata write path David Sterba
2021-04-23 11:36 ` Qu Wenruo
2021-04-23 20:31 ` David Sterba
2021-04-23 22:34 ` 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=20210406003603.64381-4-wqu@suse.com \
--to=wqu@suse.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;
as well as URLs for NNTP newsgroup(s).