diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-05-07 17:55:27 +0300 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-09-27 16:27:32 +0300 |
commit | bf6bd276b374d44f6e7146d52aa6097eb91384a3 (patch) | |
tree | 5d7eba511dce1ed1482d18633009eaaceafc4d73 | |
parent | c5ce619a77ce00d537ef512e7a823c99ce890a40 (diff) | |
download | linux-bf6bd276b374d44f6e7146d52aa6097eb91384a3.tar.xz |
mm: Add folio_pfn()
This is the folio equivalent of page_to_pfn().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
-rw-r--r-- | include/linux/mm.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 04e41d4d85ea..47143f3e7f0a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1624,6 +1624,20 @@ static inline unsigned long page_to_section(const struct page *page) } #endif +/** + * folio_pfn - Return the Page Frame Number of a folio. + * @folio: The folio. + * + * A folio may contain multiple pages. The pages have consecutive + * Page Frame Numbers. + * + * Return: The Page Frame Number of the first page in the folio. + */ +static inline unsigned long folio_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) |