Skip to content

Commit f2b229a

Browse files
Matthew Wilcoxtytso
authored andcommitted
ext4: Use a folio iterator in __read_end_io()
Iterate once per folio, not once per page. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 9ea0e45 commit f2b229a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

fs/ext4/readpage.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,16 @@ struct bio_post_read_ctx {
6868

6969
static void __read_end_io(struct bio *bio)
7070
{
71-
struct page *page;
72-
struct bio_vec *bv;
73-
struct bvec_iter_all iter_all;
71+
struct folio_iter fi;
7472

75-
bio_for_each_segment_all(bv, bio, iter_all) {
76-
page = bv->bv_page;
73+
bio_for_each_folio_all(fi, bio) {
74+
struct folio *folio = fi.folio;
7775

7876
if (bio->bi_status)
79-
ClearPageUptodate(page);
77+
folio_clear_uptodate(folio);
8078
else
81-
SetPageUptodate(page);
82-
unlock_page(page);
79+
folio_mark_uptodate(folio);
80+
folio_unlock(folio);
8381
}
8482
if (bio->bi_private)
8583
mempool_free(bio->bi_private, bio_post_read_ctx_pool);

0 commit comments

Comments
 (0)