Skip to content

Commit 6ba924d

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
buffer: use folio_end_read()
There are two places that we can use this new helper. 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 f8174a1 commit 6ba924d

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

fs/buffer.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,7 @@ static void end_buffer_async_read(struct buffer_head *bh, int uptodate)
282282
} while (tmp != bh);
283283
spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
284284

285-
/*
286-
* If all of the buffers are uptodate then we can set the page
287-
* uptodate.
288-
*/
289-
if (folio_uptodate)
290-
folio_mark_uptodate(folio);
291-
folio_unlock(folio);
285+
folio_end_read(folio, folio_uptodate);
292286
return;
293287

294288
still_busy:
@@ -2433,12 +2427,10 @@ int block_read_full_folio(struct folio *folio, get_block_t *get_block)
24332427

24342428
if (!nr) {
24352429
/*
2436-
* All buffers are uptodate - we can set the folio uptodate
2437-
* as well. But not if get_block() returned an error.
2430+
* All buffers are uptodate or get_block() returned an
2431+
* error when trying to map them - we can finish the read.
24382432
*/
2439-
if (!page_error)
2440-
folio_mark_uptodate(folio);
2441-
folio_unlock(folio);
2433+
folio_end_read(folio, !page_error);
24422434
return 0;
24432435
}
24442436

0 commit comments

Comments
 (0)