4 * management codes for pgdats and zones.
8 #include <linux/config.h>
9 #include <linux/stddef.h>
10 #include <linux/mmzone.h>
11 #include <linux/module.h>
13 struct pglist_data *first_online_pgdat(void)
15 return NODE_DATA(first_online_node);
18 EXPORT_SYMBOL(first_online_pgdat);
20 struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
22 int nid = next_online_node(pgdat->node_id);
24 if (nid == MAX_NUMNODES)
26 return NODE_DATA(nid);
28 EXPORT_SYMBOL(next_online_pgdat);
32 * next_zone - helper magic for for_each_zone()
34 struct zone *next_zone(struct zone *zone)
36 pg_data_t *pgdat = zone->zone_pgdat;
38 if (zone < pgdat->node_zones + MAX_NR_ZONES - 1)
41 pgdat = next_online_pgdat(pgdat);
43 zone = pgdat->node_zones;
49 EXPORT_SYMBOL(next_zone);