mm: Add folio_pincount_ptr()

This is the folio equivalent of compound_pincount_ptr().
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarWilliam Kucharski <william.kucharski@oracle.com>
parent 5232c63f
...@@ -1544,6 +1544,11 @@ static inline unsigned long folio_pfn(struct folio *folio) ...@@ -1544,6 +1544,11 @@ static inline unsigned long folio_pfn(struct folio *folio)
return page_to_pfn(&folio->page); return page_to_pfn(&folio->page);
} }
static inline atomic_t *folio_pincount_ptr(struct folio *folio)
{
return &folio_page(folio, 1)->compound_pincount;
}
/* MIGRATE_CMA and ZONE_MOVABLE do not allow pin pages */ /* MIGRATE_CMA and ZONE_MOVABLE do not allow pin pages */
#ifdef CONFIG_MIGRATION #ifdef CONFIG_MIGRATION
static inline bool is_pinnable_page(struct page *page) static inline bool is_pinnable_page(struct page *page)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment