[PATCH] NUMA: Add zone_to_nid function

There are many places where we need to determine the node of a zone.
Currently we use a difficult to read sequence of pointer dereferencing.
Put that into an inline function and use throughout VM.  Maybe we can find
a way to optimize the lookup in the future.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Christoph Lameter 2006-09-25 23:31:55 -07:00 committed by Linus Torvalds
parent 4415cc8df6
commit 89fa30242f
9 changed files with 17 additions and 13 deletions

View file

@ -1217,7 +1217,7 @@ unsigned int nr_free_pagecache_pages(void)
#ifdef CONFIG_NUMA
static void show_node(struct zone *zone)
{
printk("Node %d ", zone->zone_pgdat->node_id);
printk("Node %ld ", zone_to_nid(zone));
}
#else
#define show_node(zone) do { } while (0)