summaryrefslogtreecommitdiff
path: root/mm/folio-compat.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-09-02 20:46:06 +0100
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 14:02:46 -0700
commitbdb0ed54a4768dc3c2613d4c45f94c887d43cd7a (patch)
treee6a4f6b623a71f5f2483a146017d374a52b951fd /mm/folio-compat.c
parent14d01ee9fcb901c9e020f2dcd71c500f10c3bd03 (diff)
mm/swapfile: convert try_to_free_swap() to folio_free_swap()
Add kernel-doc for folio_free_swap() and make it return bool. Add a try_to_free_swap() compatibility wrapper. Link: https://lkml.kernel.org/r/20220902194653.1739778-11-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/folio-compat.c')
-rw-r--r--mm/folio-compat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/folio-compat.c b/mm/folio-compat.c
index e1e23b4947d7..06d47f00609b 100644
--- a/mm/folio-compat.c
+++ b/mm/folio-compat.c
@@ -146,3 +146,10 @@ void putback_lru_page(struct page *page)
{
folio_putback_lru(page_folio(page));
}
+
+#ifdef CONFIG_SWAP
+int try_to_free_swap(struct page *page)
+{
+ return folio_free_swap(page_folio(page));
+}
+#endif