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

Christoph Hellwig
2021-07-20T07:21:40Z

On Mon, Jul 19, 2021 at 07:40:00PM +0100, Matthew Wilcox (Oracle) wrote:
> - 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.

> /*
> - * 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.