From: Alan Huang <mmpgouride@gmail.com>
To: kent.overstreet@linux.dev
Cc: linux-bcachefs@vger.kernel.org, Alan Huang <mmpgouride@gmail.com>
Subject: [PATCH 3/3] bcachefs: Don't lock ei_pagecache_lock in bch2_readahead
Date: Fri, 8 Aug 2025 21:43:12 +0800 [thread overview]
Message-ID: <20250808134312.878432-3-mmpgouride@gmail.com> (raw)
In-Reply-To: <20250808134312.878432-1-mmpgouride@gmail.com>
The lock should already be acquired from all code path.
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
fs/bcachefs/fs-io-buffered.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/fs/bcachefs/fs-io-buffered.c b/fs/bcachefs/fs-io-buffered.c
index c16c45a72c47..01bc3e048542 100644
--- a/fs/bcachefs/fs-io-buffered.c
+++ b/fs/bcachefs/fs-io-buffered.c
@@ -70,15 +70,6 @@ static int readpages_iter_init(struct readpages_iter *iter,
return 0;
}
-static void readpages_iter_exit(struct readpages_iter *iter,
- struct readahead_control *ractl)
-{
- darray_for_each_reverse(iter->folios, folio) {
- readpages_iter_folio_revert(ractl, *folio);
- folio_get(*folio);
- }
-}
-
static inline struct folio *readpage_iter_peek(struct readpages_iter *iter)
{
if (iter->idx >= iter->folios.nr)
@@ -305,10 +296,6 @@ void bch2_readahead(struct readahead_control *ractl)
* scheduling.
*/
blk_start_plug(&plug);
- if (!bch2_pagecache_add_tryget(inode)) {
- readpages_iter_exit(&readpages_iter, ractl);
- goto out;
- }
struct btree_trans *trans = bch2_trans_get(c);
while ((folio = readpage_iter_peek(&readpages_iter))) {
@@ -334,8 +321,6 @@ void bch2_readahead(struct readahead_control *ractl)
}
bch2_trans_put(trans);
- bch2_pagecache_add_put(inode);
-out:
blk_finish_plug(&plug);
darray_exit(&readpages_iter.folios);
}
--
2.49.0
next prev parent reply other threads:[~2025-08-08 13:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 13:43 [PATCH 1/3] bcachefs: Introduce bch2_splice_read Alan Huang
2025-08-08 13:43 ` [PATCH 2/3] bcachefs: Use our own splice_read implementation Alan Huang
2025-08-08 13:43 ` Alan Huang [this message]
2025-08-08 18:28 ` [PATCH 1/3] bcachefs: Introduce bch2_splice_read Kent Overstreet
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=20250808134312.878432-3-mmpgouride@gmail.com \
--to=mmpgouride@gmail.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcachefs@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).