mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
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>
This commit is contained in:
parent
cc6ac66f1c
commit
24bbd533f5
|
|
@ -1221,6 +1221,7 @@ void folio_wait_writeback(struct folio *folio);
|
|||
int folio_wait_writeback_killable(struct folio *folio);
|
||||
void end_page_writeback(struct page *page);
|
||||
void folio_end_writeback(struct folio *folio);
|
||||
void folio_end_dropbehind(struct folio *folio);
|
||||
void folio_wait_stable(struct folio *folio);
|
||||
void __folio_mark_dirty(struct folio *folio, struct address_space *, int warn);
|
||||
void folio_account_cleaned(struct folio *folio, struct bdi_writeback *wb);
|
||||
|
|
|
|||
|
|
@ -1608,7 +1608,7 @@ static void filemap_end_dropbehind(struct folio *folio)
|
|||
* completes. Do that now. If we fail, it's likely because of a big folio -
|
||||
* just reset dropbehind for that case and latter completions should invalidate.
|
||||
*/
|
||||
static void filemap_end_dropbehind_write(struct folio *folio)
|
||||
void folio_end_dropbehind(struct folio *folio)
|
||||
{
|
||||
if (!folio_test_dropbehind(folio))
|
||||
return;
|
||||
|
|
@ -1625,6 +1625,7 @@ static void filemap_end_dropbehind_write(struct folio *folio)
|
|||
folio_unlock(folio);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(folio_end_dropbehind);
|
||||
|
||||
/**
|
||||
* folio_end_writeback - End writeback against a folio.
|
||||
|
|
@ -1660,7 +1661,7 @@ void folio_end_writeback(struct folio *folio)
|
|||
if (__folio_end_writeback(folio))
|
||||
folio_wake_bit(folio, PG_writeback);
|
||||
|
||||
filemap_end_dropbehind_write(folio);
|
||||
folio_end_dropbehind(folio);
|
||||
acct_reclaim_writeback(folio);
|
||||
folio_put(folio);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user