Thread (60 messages) 60 messages, 4 authors, 2025-09-19

Re: [PATCH v2 03/16] iomap: rename cur_folio_in_bio to folio_owned

From: Christoph Hellwig <hch@infradead.org>
Date: 2025-09-11 11:10:55
Also in: gfs2, linux-block, linux-fsdevel, linux-xfs

On Mon, Sep 08, 2025 at 11:51:09AM -0700, Joanne Koong wrote:
quoted hunk ↗ jump to hunk
The purpose of struct iomap_readpage_ctx's cur_folio_in_bio is to track
whether the folio is owned by the bio (where thus the bio is responsible
for unlocking the folio) or if it needs to be unlocked by iomap. Rename
this to folio_owned to make the purpose more clear and so that when
iomap read/readahead logic is made generic, the name also makes sense
for filesystems that don't use bios.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
---
 fs/iomap/buffered-io.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index a3b02ed5328f..598998269107 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -352,7 +352,12 @@ static void iomap_read_end_io(struct bio *bio)
 
 struct iomap_readpage_ctx {
 	struct folio		*cur_folio;
-	bool			cur_folio_in_bio;
+	/*
+	 * Is the folio owned by this readpage context, or by some
+	 * external IO helper?  Either way, the owner of the folio is
+	 * responsible for unlocking it when the read completes.
+	 */
Nit: you can use up to 80 characters for you comments.

Otherwise this looks good.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help