aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/huge_mm.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-01-18 08:56:47 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-21 12:59:02 -0400
commit346cf61311f6e348337e95aa2febe29e86137f42 (patch)
tree5213d42955d315652e3cd0d1633e693e4a1afda4 /include/linux/huge_mm.h
parentmm: Add folio_mapcount() (diff)
downloadwireguard-linux-346cf61311f6e348337e95aa2febe29e86137f42.tar.xz
wireguard-linux-346cf61311f6e348337e95aa2febe29e86137f42.zip
mm: Add split_folio_to_list()
This is a convenience function; split_huge_page_to_list() can take any page in a folio (and does so on purpose because that page will be the one which keeps the refcount). But it's convenient for the callers to pass the folio instead of the first page in the folio. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/huge_mm.h')
-rw-r--r--include/linux/huge_mm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index e4c18ba8d3bf..71c073d411ac 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -483,6 +483,12 @@ static inline bool thp_migration_supported(void)
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+static inline int split_folio_to_list(struct folio *folio,
+ struct list_head *list)
+{
+ return split_huge_page_to_list(&folio->page, list);
+}
+
/**
* thp_size - Size of a transparent huge page.
* @page: Head page of a transparent huge page.