Re: [PATCH v15 16/17] iomap: Convert iomap_add_to_ioend to take a folio

From
Christoph Hellwig <hch@infradead.org>
Date
2021-07-20 07:21:40
Also in
linux-fsdevel, linux-mm
Reply to
Matthew Wilcox (Oracle), 2021-07-19
On Mon, Jul 19, 2021 at 07:40:00PM +0100, Matthew Wilcox (Oracle) wrote:
quoted hunk ↗ jump to hunk
-	merged = __bio_try_merge_page(wpc->ioend->io_bio, page, len, poff,
-			&same_page);
 	if (iop)
 		atomic_add(len, &iop->write_bytes_pending);
-
-	if (!merged) {
-		if (bio_full(wpc->ioend->io_bio, len)) {
-			wpc->ioend->io_bio =
-				iomap_chain_bio(wpc->ioend->io_bio);
-		}
-		bio_add_page(wpc->ioend->io_bio, page, len, poff);
+	if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) {
+		wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio);
+		bio_add_folio(wpc->ioend->io_bio, folio, len, poff);
 	}
I actually have pretty similar changes for the red and write path to
avoid __bio_try_merge_page in my queue.  I'll send them out ASAP as
I think such a change should be done separately from the folio
switch.
quoted hunk ↗ jump to hunk
 	/*
-	 * Walk through the page to find areas to write back. If we run off the
-	 * end of the current map or find the current map invalid, grab a new
-	 * one.
+	 * Walk through the folio to find areas to write back. If we
+	 * run off the end of the current map or find the current map
+	 * invalid, grab a new one.
Why the reformatting?

Otherwise this looks sane to me.
Thread (62 messages) 62 messages, 5 authors, last reply 2021-07-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help