From: gouhao@uniontech.com
To: viro@zeniv.linux.org.uk, brauner@kernel.org, axboe@kernel.dk
Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] fs/buffer: using __bio_add_page in submit_bh_wbc()
Date: Tue, 30 May 2023 11:32:39 +0800 [thread overview]
Message-ID: <20230530033239.17534-1-gouhao@uniontech.com> (raw)
From: Gou Hao <gouhao@uniontech.com>
In submit_bh_wbc(), bio is newly allocated, so it
does not need any merging logic.
And using bio_add_page here will execute 'bio_flagged(
bio, BIO_CLONED)' and 'bio_full' twice, which is unnecessary.
Signed-off-by: Gou Hao <gouhao@uniontech.com>
---
fs/buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index a7fc561758b1..5abc26d8399d 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2760,7 +2760,7 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
- bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh));
+ __bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh));
BUG_ON(bio->bi_iter.bi_size != bh->b_size);
bio->bi_end_io = end_bio_bh_io_sync;
--
2.20.1
next reply other threads:[~2023-05-30 3:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 3:32 gouhao [this message]
2023-05-30 3:39 ` [PATCH] fs/buffer: using __bio_add_page in submit_bh_wbc() Matthew Wilcox
2023-05-30 3:52 ` Gou Hao
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=20230530033239.17534-1-gouhao@uniontech.com \
--to=gouhao@uniontech.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).