
Make sure not to count on a pgdat's mem_map being contiguous.
Use a (theoretically) slower pfn_to_page() call and do the 
math with pfns instead of pointer arithmetic on node_mem_map[]
when that assumption can't be satisfied.

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

 memhotplug-dave/include/linux/mmzone.h |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN include/linux/mmzone.h~B-sparse-154-sparse-no-node_mem_map include/linux/mmzone.h
--- memhotplug/include/linux/mmzone.h~B-sparse-154-sparse-no-node_mem_map	2005-04-13 14:20:12.000000000 -0700
+++ memhotplug-dave/include/linux/mmzone.h	2005-04-13 14:20:12.000000000 -0700
@@ -269,7 +269,11 @@ typedef struct pglist_data {
 
 #define node_present_pages(nid)	(NODE_DATA(nid)->node_present_pages)
 #define node_spanned_pages(nid)	(NODE_DATA(nid)->node_spanned_pages)
+#ifdef CONFIG_FLAT_NODE_MEM_MAP
 #define pgdat_page_nr(pgdat, pagenr)	((pgdat)->node_mem_map + (pagenr))
+#else
+#define pgdat_page_nr(pgdat, pagenr)	pfn_to_page((pgdat)->node_start_pfn + (pagenr))
+#endif
 #define nid_page_nr(nid, pagenr) 	pgdat_page_nr(NODE_DATA(nid),(pagenr))
 
 extern struct pglist_data *pgdat_list;
_
