lkml.org 
[lkml]   [2021]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v13 051/137] mm: Add folio_pfn()
    Date
    This is the folio equivalent of page_to_pfn().

    Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    ---
    include/linux/mm.h | 14 ++++++++++++++
    1 file changed, 14 insertions(+)

    diff --git a/include/linux/mm.h b/include/linux/mm.h
    index 80f27eb151ba..fa5974870660 100644
    --- a/include/linux/mm.h
    +++ b/include/linux/mm.h
    @@ -1622,6 +1622,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)
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-07-12 05:37    [W:4.066 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site