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.

filemap: Add a helper for filesystems implementing dropbehind

Add a helper to allow filesystems to attempt to free the 'dropbehind'
folio.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Link: https://lore.kernel.org/all/5588a06f6d5a2cf6746828e2d36e7ada668b1739.1745381692.git.trond.myklebust@hammerspace.com/
Reviewed-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

authored by

Trond Myklebust and committed by
Anna Schumaker
24bbd533 cc6ac66f

+4 -2
+1
include/linux/pagemap.h
··· 1221 1221 int folio_wait_writeback_killable(struct folio *folio); 1222 1222 void end_page_writeback(struct page *page); 1223 1223 void folio_end_writeback(struct folio *folio); 1224 + void folio_end_dropbehind(struct folio *folio); 1224 1225 void folio_wait_stable(struct folio *folio); 1225 1226 void __folio_mark_dirty(struct folio *folio, struct address_space *, int warn); 1226 1227 void folio_account_cleaned(struct folio *folio, struct bdi_writeback *wb);
+3 -2
mm/filemap.c
··· 1608 1608 * completes. Do that now. If we fail, it's likely because of a big folio - 1609 1609 * just reset dropbehind for that case and latter completions should invalidate. 1610 1610 */ 1611 - static void filemap_end_dropbehind_write(struct folio *folio) 1611 + void folio_end_dropbehind(struct folio *folio) 1612 1612 { 1613 1613 if (!folio_test_dropbehind(folio)) 1614 1614 return; ··· 1625 1625 folio_unlock(folio); 1626 1626 } 1627 1627 } 1628 + EXPORT_SYMBOL_GPL(folio_end_dropbehind); 1628 1629 1629 1630 /** 1630 1631 * folio_end_writeback - End writeback against a folio. ··· 1661 1660 if (__folio_end_writeback(folio)) 1662 1661 folio_wake_bit(folio, PG_writeback); 1663 1662 1664 - filemap_end_dropbehind_write(folio); 1663 + folio_end_dropbehind(folio); 1665 1664 acct_reclaim_writeback(folio); 1666 1665 folio_put(folio); 1667 1666 }