--- memhotplug-dave/include/linux/mmzone.h | 104 ++++++++++++++++----------------- 1 files changed, 53 insertions(+), 51 deletions(-) diff -puN include/linux/mmzone.h~no-pgdat-list-fix include/linux/mmzone.h --- memhotplug/include/linux/mmzone.h~no-pgdat-list-fix 2005-09-30 08:59:56.000000000 -0700 +++ memhotplug-dave/include/linux/mmzone.h 2005-09-30 09:06:10.000000000 -0700 @@ -15,6 +15,7 @@ #include #include #include +#include #include /* Free memory management - zoned buddy allocator. */ @@ -342,6 +343,58 @@ static inline void memory_present(int ni unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); #endif +static inline int is_highmem_idx(int idx) +{ + return (idx == ZONE_HIGHMEM); +} + +static inline int is_normal_idx(int idx) +{ + return (idx == ZONE_NORMAL); +} +/** + * is_highmem - helper function to quickly check if a struct zone is a + * highmem zone or not. This is an attempt to keep references + * to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum. + * @zone - pointer to struct zone variable + */ +static inline int is_highmem(struct zone *zone) +{ + return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; +} + +static inline int is_normal(struct zone *zone) +{ + return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; +} + +/* These two functions are used to setup the per zone pages min values */ +struct ctl_table; +struct file; +int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, + void __user *, size_t *, loff_t *); +extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; +int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, + void __user *, size_t *, loff_t *); + +#include +/* Returns the number of the current Node. */ +#define numa_node_id() (cpu_to_node(raw_smp_processor_id())) + +#ifndef CONFIG_NEED_MULTIPLE_NODES + +extern struct pglist_data contig_page_data; +#define NODE_DATA(nid) (&contig_page_data) +#define NODE_MEM_MAP(nid) mem_map +#define MAX_NODES_SHIFT 1 +#define pfn_to_nid(pfn) (0) + +#else /* CONFIG_NEED_MULTIPLE_NODES */ + +#include + +#endif /* !CONFIG_NEED_MULTIPLE_NODES */ + /* * zone_idx() returns 0 for the ZONE_DMA zone, 1 for the ZONE_NORMAL zone, etc. */ @@ -408,57 +461,6 @@ static inline struct zone *next_zone(str for (zone = first_online_pgdat()->node_zones; \ zone; zone = next_zone(zone)) -static inline int is_highmem_idx(int idx) -{ - return (idx == ZONE_HIGHMEM); -} - -static inline int is_normal_idx(int idx) -{ - return (idx == ZONE_NORMAL); -} -/** - * is_highmem - helper function to quickly check if a struct zone is a - * highmem zone or not. This is an attempt to keep references - * to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum. - * @zone - pointer to struct zone variable - */ -static inline int is_highmem(struct zone *zone) -{ - return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; -} - -static inline int is_normal(struct zone *zone) -{ - return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; -} - -/* These two functions are used to setup the per zone pages min values */ -struct ctl_table; -struct file; -int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, - void __user *, size_t *, loff_t *); -extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1]; -int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *, - void __user *, size_t *, loff_t *); - -#include -/* Returns the number of the current Node. */ -#define numa_node_id() (cpu_to_node(raw_smp_processor_id())) - -#ifndef CONFIG_NEED_MULTIPLE_NODES - -extern struct pglist_data contig_page_data; -#define NODE_DATA(nid) (&contig_page_data) -#define NODE_MEM_MAP(nid) mem_map -#define MAX_NODES_SHIFT 1 -#define pfn_to_nid(pfn) (0) - -#else /* CONFIG_NEED_MULTIPLE_NODES */ - -#include - -#endif /* !CONFIG_NEED_MULTIPLE_NODES */ #ifdef CONFIG_SPARSEMEM #include _