Message ID | 20210331184728.1188084-3-willy@infradead.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Memory Folios | expand |
On Wed, Mar 31, 2021 at 07:47:03PM +0100, Matthew Wilcox (Oracle) wrote: > These are just convenience wrappers for callers with folios; pgdat and > zone can be reached from tail pages as well as head pages. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> > Reviewed-by: Zi Yan <ziy@nvidia.com> Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/include/linux/mm.h b/include/linux/mm.h index 761063e733bf..195c4740522d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1546,6 +1546,16 @@ static inline pg_data_t *page_pgdat(const struct page *page) return NODE_DATA(page_to_nid(page)); } +static inline struct zone *folio_zone(const struct folio *folio) +{ + return page_zone(&folio->page); +} + +static inline pg_data_t *folio_pgdat(const struct folio *folio) +{ + return page_pgdat(&folio->page); +} + #ifdef SECTION_IN_PAGE_FLAGS static inline void set_page_section(struct page *page, unsigned long section) {