
This makes the remap code a little bit more readable.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---

 memhotplug-dave/include/linux/bootmem.h |   10 ++++++++++
 memhotplug-dave/mm/page_alloc.c         |    9 ++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff -puN include/linux/bootmem.h~B1.1-alloc_bootmem_remap_node-i386 include/linux/bootmem.h
--- memhotplug/include/linux/bootmem.h~B1.1-alloc_bootmem_remap_node-i386	2005-01-04 13:49:30.000000000 -0800
+++ memhotplug-dave/include/linux/bootmem.h	2005-01-04 13:49:30.000000000 -0800
@@ -77,6 +77,16 @@ static inline void *alloc_remap(int nid,
 }
 #endif
 
+static inline void *alloc_bootmem_node_remap(struct pglist_data *pgdat, unsigned long size)
+{
+	void *alloc = alloc_remap(pgdat->node_id, size);
+
+	if (!alloc)
+		alloc = alloc_bootmem_node(pgdat, size);
+
+	return alloc;
+}
+
 extern unsigned long __initdata nr_kernel_pages;
 extern unsigned long __initdata nr_all_pages;
 
diff -puN mm/page_alloc.c~B1.1-alloc_bootmem_remap_node-i386 mm/page_alloc.c
--- memhotplug/mm/page_alloc.c~B1.1-alloc_bootmem_remap_node-i386	2005-01-04 13:49:30.000000000 -0800
+++ memhotplug-dave/mm/page_alloc.c	2005-01-04 13:49:30.000000000 -0800
@@ -1766,7 +1766,6 @@ static void __init free_area_init_core(s
 static void __init alloc_node_mem_map(struct pglist_data *pgdat)
 {
 	unsigned long size;
-	void *map;
 
 	/*
 	 * Make sure that the architecture hasn't already allocated
@@ -1776,12 +1775,8 @@ static void __init alloc_node_mem_map(st
 		return;
 
 	size = (pgdat->node_spanned_pages + 1) * sizeof(struct page);
-
-	map = alloc_remap(pgdat->node_id, size);
-	if (!map)
-		map = alloc_bootmem_node(pgdat, size);
-	pgdat->node_mem_map = map;
-
+	pgdat->node_mem_map =
+		alloc_bootmem_node_remap(pgdat, size);
 #ifndef CONFIG_DISCONTIGMEM
 	/*
 	 * With no DISCONTIG, the global mem_map is just set as node 0's
_
