mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-31 16:38:12 +00:00
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>
This commit is contained in:
parent
c5ce619a77
commit
bf6bd276b3
1 changed files with 14 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue