Re: [RFC PATCH 2/3] mpage: use bio_for_each_folio_all in mpage_end_io()

From: Matthew Wilcox
Date: Wed Mar 15 2023 - 12:10:24 EST


On Wed, Mar 15, 2023 at 03:52:15PM +0100, Hannes Reinecke wrote:
> On 3/15/23 13:32, Pankaj Raghav wrote:
> > Use bio_for_each_folio_all to iterate through folios in a bio so that
> > the folios can be directly passed to the folio_endio() function.
> > + bio_for_each_folio_all(fi, bio)
> > + folio_endio(fi.folio, bio_op(bio),
> > + blk_status_to_errno(bio->bi_status));
> > bio_put(bio);
> > }
>
> Ah. Here it is.
>
> I would suggest merge these two patches.

The right way to have handled this patch series was:

1. Introduce a new folio_endio() [but see Christoph's mail on why we
shouldn't do that]
2-n convert callers to use folios directly
n+1 remove page_endio() entirely.

Note that patch n+1 might not be part of this patch series; sometimes
it takes a while to convert all callers to use folios.

I very much dislike the way this was done by pushing the page_folio()
call into each of the callers because it makes the entire series hard to
review.