Skip to content

Commit

Permalink
erofs: convert z_erofs_submissionqueue_endio() to folios
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
hsiangkao committed Mar 10, 2024
1 parent 92cc38e commit 9266f2d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions fs/erofs/zdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,19 +1566,19 @@ static void z_erofs_submissionqueue_endio(struct bio *bio)
{
struct z_erofs_decompressqueue *q = bio->bi_private;
blk_status_t err = bio->bi_status;
struct bio_vec *bvec;
struct bvec_iter_all iter_all;
struct folio_iter fi;

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

DBG_BUGON(PageUptodate(page));
DBG_BUGON(z_erofs_page_is_invalidated(page));
if (erofs_page_is_managed(EROFS_SB(q->sb), page)) {
if (!err)
SetPageUptodate(page);
unlock_page(page);
}
DBG_BUGON(folio_test_uptodate(folio));
DBG_BUGON(z_erofs_page_is_invalidated(&folio->page));
if (!erofs_page_is_managed(EROFS_SB(q->sb), &folio->page))
continue;

if (!err)
folio_mark_uptodate(folio);
folio_unlock(folio);
}
if (err)
q->eio = true;
Expand Down

0 comments on commit 9266f2d

Please sign in to comment.