lkml.org 
[lkml]   [2013]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v2 06/25] mm: add nid_zone() helper
Date
Add nid_zone(), which returns the zone corresponding to a given nid & zonenum.

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
---
include/linux/mm.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 9ddae00..1b6abae 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -708,9 +708,14 @@ static inline void page_nid_reset_last(struct page *page)
}
#endif

+static inline struct zone *nid_zone(int nid, enum zone_type zonenum)
+{
+ return &NODE_DATA(nid)->node_zones[zonenum];
+}
+
static inline struct zone *page_zone(const struct page *page)
{
- return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)];
+ return nid_zone(page_to_nid(page), page_zonenum(page));
}

#ifdef SECTION_IN_PAGE_FLAGS
--
1.8.2.1


\
 
 \ /
  Last update: 2013-04-12 03:41    [W:0.084 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site