Skip to content

Commit f8174a1

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
ext4: use folio_end_read()
folio_end_read() is the perfect fit for ext4. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Cc: Albert Ou <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Andreas Dilger <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Vasily Gorbik <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 0b23704 commit f8174a1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

fs/ext4/readpage.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,8 @@ static void __read_end_io(struct bio *bio)
7070
{
7171
struct folio_iter fi;
7272

73-
bio_for_each_folio_all(fi, bio) {
74-
struct folio *folio = fi.folio;
75-
76-
if (bio->bi_status)
77-
folio_clear_uptodate(folio);
78-
else
79-
folio_mark_uptodate(folio);
80-
folio_unlock(folio);
81-
}
73+
bio_for_each_folio_all(fi, bio)
74+
folio_end_read(fi.folio, bio->bi_status == 0);
8275
if (bio->bi_private)
8376
mempool_free(bio->bi_private, bio_post_read_ctx_pool);
8477
bio_put(bio);
@@ -336,8 +329,7 @@ int ext4_mpage_readpages(struct inode *inode,
336329
if (ext4_need_verity(inode, folio->index) &&
337330
!fsverity_verify_folio(folio))
338331
goto set_error_page;
339-
folio_mark_uptodate(folio);
340-
folio_unlock(folio);
332+
folio_end_read(folio, true);
341333
continue;
342334
}
343335
} else if (fully_mapped) {

0 commit comments

Comments
 (0)