Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: add folio_end_read()

Provide a function for filesystems to call when they have finished reading
an entire folio.

Link: https://lkml.kernel.org/r/20231004165317.1061855-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
0b237047 f45b494e

+23
+1
include/linux/pagemap.h
··· 1101 1101 folio_wait_locked(page_folio(page)); 1102 1102 } 1103 1103 1104 + void folio_end_read(struct folio *folio, bool success); 1104 1105 void wait_on_page_writeback(struct page *page); 1105 1106 void folio_wait_writeback(struct folio *folio); 1106 1107 int folio_wait_writeback_killable(struct folio *folio);
+22
mm/filemap.c
··· 1526 1526 EXPORT_SYMBOL(folio_unlock); 1527 1527 1528 1528 /** 1529 + * folio_end_read - End read on a folio. 1530 + * @folio: The folio. 1531 + * @success: True if all reads completed successfully. 1532 + * 1533 + * When all reads against a folio have completed, filesystems should 1534 + * call this function to let the pagecache know that no more reads 1535 + * are outstanding. This will unlock the folio and wake up any thread 1536 + * sleeping on the lock. The folio will also be marked uptodate if all 1537 + * reads succeeded. 1538 + * 1539 + * Context: May be called from interrupt or process context. May not be 1540 + * called from NMI context. 1541 + */ 1542 + void folio_end_read(struct folio *folio, bool success) 1543 + { 1544 + if (likely(success)) 1545 + folio_mark_uptodate(folio); 1546 + folio_unlock(folio); 1547 + } 1548 + EXPORT_SYMBOL(folio_end_read); 1549 + 1550 + /** 1529 1551 * folio_end_private_2 - Clear PG_private_2 and wake any waiters. 1530 1552 * @folio: The folio. 1531 1553 *