summaryrefslogtreecommitdiff
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-01 14:35:31 +0300
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-10 06:12:52 +0300
commitd2329aa0c78f4a8dd368bb706f196ab99f692eaa (patch)
tree8dcdbf74ed2e54f05633b58585aa0bcb9027c046 /mm/vmscan.c
parent6439476311a649594124c4cf42f8389661f04e4f (diff)
downloadlinux-d2329aa0c78f4a8dd368bb706f196ab99f692eaa.tar.xz
fs: Add free_folio address space operation
Include documentation and convert the callers to use ->free_folio as well as ->freepage. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index f3f7ce2c4068..d8a031128ad0 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1282,8 +1282,10 @@ static int __remove_mapping(struct address_space *mapping, struct folio *folio,
xa_unlock_irq(&mapping->i_pages);
put_swap_page(&folio->page, swap);
} else {
+ void (*free_folio)(struct folio *);
void (*freepage)(struct page *);
+ free_folio = mapping->a_ops->free_folio;
freepage = mapping->a_ops->freepage;
/*
* Remember a shadow entry for reclaimed file cache in
@@ -1310,7 +1312,9 @@ static int __remove_mapping(struct address_space *mapping, struct folio *folio,
inode_add_lru(mapping->host);
spin_unlock(&mapping->host->i_lock);
- if (freepage != NULL)
+ if (free_folio)
+ free_folio(folio);
+ if (freepage)
freepage(&folio->page);
}