The pfn of a folio is the pfn of its head page. Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> --- include/linux/mm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index 9b7030d1899f..2c7b6ae1d3fc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1619,6 +1619,11 @@ static inline unsigned long page_to_section(const struct page *page) } #endif +static inline unsigned long folio_to_pfn(struct folio *folio) +{ + return page_to_pfn(&folio->page); +} + /* MIGRATE_CMA and ZONE_MOVABLE do not allow pin pages */ #ifdef CONFIG_MIGRATION static inline bool is_pinnable_page(struct page *page) -- 2.30.2