lkml.org 
[lkml]   [2023]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH 2/3] mpage: use bio_for_each_folio_all in mpage_end_io()
From
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.
>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
> fs/mpage.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/fs/mpage.c b/fs/mpage.c
> index 40e86e839e77..bfcc139938a8 100644
> --- a/fs/mpage.c
> +++ b/fs/mpage.c
> @@ -45,14 +45,11 @@
> */
> static void mpage_end_io(struct bio *bio)
> {
> - struct bio_vec *bv;
> - struct bvec_iter_all iter_all;
> + struct folio_iter fi;
>
> - bio_for_each_segment_all(bv, bio, iter_all) {
> - struct page *page = bv->bv_page;
> - folio_endio(page_folio(page), bio_op(bio),
> - blk_status_to_errno(bio->bi_status));
> - }
> + 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.

Cheers,

Hannes

\
 
 \ /
  Last update: 2023-03-27 01:01    [W:0.336 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site