aboutsummaryrefslogtreecommitdiff
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorGravatar Matthew Wilcox (Oracle) <willy@infradead.org> 2022-01-17 16:33:26 -0500
committerGravatar Matthew Wilcox (Oracle) <willy@infradead.org> 2022-03-21 12:59:02 -0400
commit4ba1119cd53166d853050ff1a9d76079cd8f8e06 (patch)
treea70d8b819fcce1322e1193bbae30676eb3ce0ebf /include/linux/mm.h
parentmm: Turn head_compound_mapcount() into folio_entire_mapcount() (diff)
downloadlinux-4ba1119cd53166d853050ff1a9d76079cd8f8e06.tar.gz
linux-4ba1119cd53166d853050ff1a9d76079cd8f8e06.tar.bz2
linux-4ba1119cd53166d853050ff1a9d76079cd8f8e06.zip
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/linux/mm.h')
-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)