This implements the same algorithm as total_mapcount(), which is transformed into a wrapper function.
Showing the changes to include (1 of 3 files). Show all
Unified · Split
| @@ -825,8 +825,14 @@ static inline int page_mapcount(struct page *page) · 824 unmodified lines | |||
| 825 | return atomic_read(&page->_mapcount) + 1; | 825 | return atomic_read(&page->_mapcount) + 1; |
| 826 | } | 826 | } |
| 827 | 827 | ||
| 828 | int folio_mapcount(struct folio *folio); | ||
| 829 | |||
| 828 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 830 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 829 | int total_mapcount(struct page *page); | 831 | static inline int total_mapcount(struct page *page) |
| 832 | { | ||
| 833 | return folio_mapcount(page_folio(page)); | ||
| 834 | } | ||
| 835 | |||
| 830 | int page_trans_huge_mapcount(struct page *page); | 836 | int page_trans_huge_mapcount(struct page *page); |
| 831 | #else | 837 | #else |
| 832 | static inline int total_mapcount(struct page *page) | 838 | static inline int total_mapcount(struct page *page) |