aboutsummaryrefslogtreecommitdiff
path: root/mm/folio-compat.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle)2021-12-24 13:26:22 -0500
committerMatthew Wilcox (Oracle)2022-03-21 12:56:36 -0400
commitd1d8a3b4d06d8c9188f2b9b89ef053db0bf899de (patch)
tree668fcf14a95d86b2f699a9f9f4dda405ada015e4 /mm/folio-compat.c
parent659508f9c936aa6e3aaf6e9cf6a4a8836b8f8355 (diff)
mm: Turn isolate_lru_page() into folio_isolate_lru()
Add isolate_lru_page() as a wrapper around isolate_lru_folio(). TestClearPageLRU() would have always failed on a tail page, so returning -EBUSY is the same behaviour. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: John Hubbard <jhubbard@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Diffstat (limited to 'mm/folio-compat.c')
-rw-r--r--mm/folio-compat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mm/folio-compat.c b/mm/folio-compat.c
index 749555a232a8..a4a7725f4486 100644
--- a/mm/folio-compat.c
+++ b/mm/folio-compat.c
@@ -7,6 +7,7 @@
#include <linux/migrate.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
+#include "internal.h"
struct address_space *page_mapping(struct page *page)
{
@@ -151,3 +152,10 @@ int try_to_release_page(struct page *page, gfp_t gfp)
return filemap_release_folio(page_folio(page), gfp);
}
EXPORT_SYMBOL(try_to_release_page);
+
+int isolate_lru_page(struct page *page)
+{
+ if (WARN_RATELIMIT(PageTail(page), "trying to isolate tail page"))
+ return -EBUSY;
+ return folio_isolate_lru((struct folio *)page);
+}