
There is some confusion with the SPARSEMEM patch between what
is needed for DISCONTIG vs. NUMA.  For instance, the NODE_DATA()
macro needs to be switched on NUMA, but not on FLATMEM.

This patch is required if the previous patch is applied.

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

 memhotplug-dave/arch/i386/mm/init.c       |   12 ++++++------
 memhotplug-dave/include/asm-i386/mmzone.h |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff -puN arch/i386/mm/init.c~B-sparse-161-i386-separate-flatmem-and-numa arch/i386/mm/init.c
--- memhotplug/arch/i386/mm/init.c~B-sparse-161-i386-separate-flatmem-and-numa	2005-04-13 14:20:17.000000000 -0700
+++ memhotplug-dave/arch/i386/mm/init.c	2005-04-13 14:20:17.000000000 -0700
@@ -277,7 +277,9 @@ void __init one_highpage_init(struct pag
 		SetPageReserved(page);
 }
 
-#ifdef CONFIG_FLATMEM
+#ifdef CONFIG_NUMA
+extern void set_highmem_pages_init(int);
+#else
 static void __init set_highmem_pages_init(int bad_ppro)
 {
 	int pfn;
@@ -285,8 +287,6 @@ static void __init set_highmem_pages_ini
 		one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro);
 	totalram_pages += totalhigh_pages;
 }
-#else
-extern void set_highmem_pages_init(int);
 #endif /* CONFIG_FLATMEM */
 
 #else
@@ -298,10 +298,10 @@ extern void set_highmem_pages_init(int);
 unsigned long long __PAGE_KERNEL = _PAGE_KERNEL;
 unsigned long long __PAGE_KERNEL_EXEC = _PAGE_KERNEL_EXEC;
 
-#ifdef CONFIG_FLATMEM
-#define remap_numa_kva() do {} while (0)
-#else
+#ifdef CONFIG_NUMA
 extern void __init remap_numa_kva(void);
+#else
+#define remap_numa_kva() do {} while (0)
 #endif
 
 static void __init pagetable_init (void)
diff -puN include/asm-i386/mmzone.h~B-sparse-161-i386-separate-flatmem-and-numa include/asm-i386/mmzone.h
--- memhotplug/include/asm-i386/mmzone.h~B-sparse-161-i386-separate-flatmem-and-numa	2005-04-13 14:20:17.000000000 -0700
+++ memhotplug-dave/include/asm-i386/mmzone.h	2005-04-13 14:20:17.000000000 -0700
@@ -8,7 +8,7 @@
 
 #include <asm/smp.h>
 
-#if defined(CONFIG_DISCONTIGMEM) || defined(CONFIG_SPARSEMEM)
+#if CONFIG_NUMA
 extern struct pglist_data *node_data[];
 #define NODE_DATA(nid)	(node_data[nid])
 
@@ -42,7 +42,7 @@ static inline void get_memcfg_numa(void)
 	get_memcfg_numa_flat();
 }
 
-#endif /* !CONFIG_DISCONTIGMEM || !CONFIG_SPARSEMEM */
+#endif /* CONFIG_NUMA */
 
 #ifdef CONFIG_DISCONTIGMEM
 
_
