Skip to content

Commit 9266f2d

Browse files
committed
erofs: convert z_erofs_submissionqueue_endio() to folios
Use bio_for_each_folio() to iterate over each folio in the bio and there is no large folios for now. Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 92cc38e commit 9266f2d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

fs/erofs/zdata.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,19 +1566,19 @@ static void z_erofs_submissionqueue_endio(struct bio *bio)
15661566
{
15671567
struct z_erofs_decompressqueue *q = bio->bi_private;
15681568
blk_status_t err = bio->bi_status;
1569-
struct bio_vec *bvec;
1570-
struct bvec_iter_all iter_all;
1569+
struct folio_iter fi;
15711570

1572-
bio_for_each_segment_all(bvec, bio, iter_all) {
1573-
struct page *page = bvec->bv_page;
1571+
bio_for_each_folio_all(fi, bio) {
1572+
struct folio *folio = fi.folio;
15741573

1575-
DBG_BUGON(PageUptodate(page));
1576-
DBG_BUGON(z_erofs_page_is_invalidated(page));
1577-
if (erofs_page_is_managed(EROFS_SB(q->sb), page)) {
1578-
if (!err)
1579-
SetPageUptodate(page);
1580-
unlock_page(page);
1581-
}
1574+
DBG_BUGON(folio_test_uptodate(folio));
1575+
DBG_BUGON(z_erofs_page_is_invalidated(&folio->page));
1576+
if (!erofs_page_is_managed(EROFS_SB(q->sb), &folio->page))
1577+
continue;
1578+
1579+
if (!err)
1580+
folio_mark_uptodate(folio);
1581+
folio_unlock(folio);
15821582
}
15831583
if (err)
15841584
q->eio = true;

0 commit comments

Comments
 (0)