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 <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240305091448.1384242-5-hsiangkao@linux.alibaba.com
This commit is contained in:
Gao Xiang 2024-03-05 17:14:47 +08:00
parent 92cc38e02a
commit 9266f2dc5e

View File

@ -1566,19 +1566,19 @@ static void z_erofs_submissionqueue_endio(struct bio *bio)
{ {
struct z_erofs_decompressqueue *q = bio->bi_private; struct z_erofs_decompressqueue *q = bio->bi_private;
blk_status_t err = bio->bi_status; blk_status_t err = bio->bi_status;
struct bio_vec *bvec; struct folio_iter fi;
struct bvec_iter_all iter_all;
bio_for_each_segment_all(bvec, bio, iter_all) { bio_for_each_folio_all(fi, bio) {
struct page *page = bvec->bv_page; struct folio *folio = fi.folio;
DBG_BUGON(PageUptodate(page)); DBG_BUGON(folio_test_uptodate(folio));
DBG_BUGON(z_erofs_page_is_invalidated(page)); DBG_BUGON(z_erofs_page_is_invalidated(&folio->page));
if (erofs_page_is_managed(EROFS_SB(q->sb), page)) { if (!erofs_page_is_managed(EROFS_SB(q->sb), &folio->page))
if (!err) continue;
SetPageUptodate(page);
unlock_page(page); if (!err)
} folio_mark_uptodate(folio);
folio_unlock(folio);
} }
if (err) if (err)
q->eio = true; q->eio = true;