Message ID | 20210622121551.3398730-2-willy@infradead.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Folio-enabling the page cache | expand |
On Tue, Jun 22, 2021 at 01:15:06PM +0100, Matthew Wilcox (Oracle) wrote: > The pfn of a folio is the pfn of its head page. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Maybe add a kerneldoc comment stating that?
On Wed, Jun 23, 2021 at 08:49:55AM +0100, Christoph Hellwig wrote: > On Tue, Jun 22, 2021 at 01:15:06PM +0100, Matthew Wilcox (Oracle) wrote: > > The pfn of a folio is the pfn of its head page. > > > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> > > Maybe add a kerneldoc comment stating that? /** * folio_to_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. */
On Thu, Jun 24, 2021 at 04:12:05PM +0100, Matthew Wilcox wrote: > On Wed, Jun 23, 2021 at 08:49:55AM +0100, Christoph Hellwig wrote: > > On Tue, Jun 22, 2021 at 01:15:06PM +0100, Matthew Wilcox (Oracle) wrote: > > > The pfn of a folio is the pfn of its head page. > > > > > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> > > > > Maybe add a kerneldoc comment stating that? > > /** > * folio_to_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. > */ Looks fine.
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)
The pfn of a folio is the pfn of its head page. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- include/linux/mm.h | 5 +++++ 1 file changed, 5 insertions(+)