Thread (52 messages) 52 messages, 6 authors, 2021-03-22
STALE1922d REVIEWED: 3 (3M)
Revisions (5)
  1. rfc [diff vs current]
  2. v1 [diff vs current]
  3. v2 [diff vs current]
  4. v3 [diff vs current]
  5. v4 current

[PATCH v4 02/25] mm: Add folio_pgdat and folio_zone

From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Date: 2021-03-05 04:19:19
Also in: linux-fsdevel, lkml
Subsystem: memory management - core, the rest · Maintainers: Andrew Morton, David Hildenbrand, Linus Torvalds

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>
---
 include/linux/mm.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a46e5a4385b0..ecfe202aa4ec 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1488,6 +1488,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)
 {
-- 
2.30.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help