summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-01-18 00:33:26 +0300
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-21 19:59:02 +0300
commit4ba1119cd53166d853050ff1a9d76079cd8f8e06 (patch)
treea70d8b819fcce1322e1193bbae30676eb3ce0ebf /include
parent74e8ee4708a8edabbbc7ab8c12ec24d7a561bb41 (diff)
downloadlinux-4ba1119cd53166d853050ff1a9d76079cd8f8e06.tar.xz
mm: Add folio_mapcount()
This implements the same algorithm as total_mapcount(), which is transformed into a wrapper function. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 70f0ca217962..0d380dc26847 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -825,8 +825,14 @@ static inline int page_mapcount(struct page *page)
return atomic_read(&page->_mapcount) + 1;
}
+int folio_mapcount(struct folio *folio);
+
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-int total_mapcount(struct page *page);
+static inline int total_mapcount(struct page *page)
+{
+ return folio_mapcount(page_folio(page));
+}
+
int page_trans_huge_mapcount(struct page *page);
#else
static inline int total_mapcount(struct page *page)