aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f2018775b995..856f0ee7e84a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -499,12 +499,17 @@ static inline struct zone *page_zone(struct page *page)
499 return zone_table[page_zone_id(page)]; 499 return zone_table[page_zone_id(page)];
500} 500}
501 501
502static inline unsigned long zone_to_nid(struct zone *zone)
503{
504 return zone->zone_pgdat->node_id;
505}
506
502static inline unsigned long page_to_nid(struct page *page) 507static inline unsigned long page_to_nid(struct page *page)
503{ 508{
504 if (FLAGS_HAS_NODE) 509 if (FLAGS_HAS_NODE)
505 return (page->flags >> NODES_PGSHIFT) & NODES_MASK; 510 return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
506 else 511 else
507 return page_zone(page)->zone_pgdat->node_id; 512 return zone_to_nid(page_zone(page));
508} 513}
509static inline unsigned long page_to_section(struct page *page) 514static inline unsigned long page_to_section(struct page *page)
510{ 515{