Merge git://git.infradead.org/hdrcleanup-2.6
[powerpc.git] / include / linux / mmzone.h
index 0d12c3c..9742e3c 100644 (file)
@@ -4,7 +4,6 @@
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
-#include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
 #include <linux/wait.h>
@@ -15,6 +14,7 @@
 #include <linux/seqlock.h>
 #include <linux/nodemask.h>
 #include <asm/atomic.h>
+#include <asm/page.h>
 
 /* Free memory management - zoned buddy allocator.  */
 #ifndef CONFIG_FORCE_MAX_ZONEORDER
@@ -22,6 +22,7 @@
 #else
 #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
 #endif
+#define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1))
 
 struct free_area {
        struct list_head        free_list;
@@ -418,20 +419,9 @@ extern struct pglist_data contig_page_data;
 
 #endif /* !CONFIG_NEED_MULTIPLE_NODES */
 
-static inline struct pglist_data *first_online_pgdat(void)
-{
-       return NODE_DATA(first_online_node);
-}
-
-static inline struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
-{
-       int nid = next_online_node(pgdat->node_id);
-
-       if (nid == MAX_NUMNODES)
-               return NULL;
-       return NODE_DATA(nid);
-}
-
+extern struct pglist_data *first_online_pgdat(void);
+extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
+extern struct zone *next_zone(struct zone *zone);
 
 /**
  * for_each_pgdat - helper macro to iterate over all nodes
@@ -441,27 +431,6 @@ static inline struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
        for (pgdat = first_online_pgdat();              \
             pgdat;                                     \
             pgdat = next_online_pgdat(pgdat))
-
-/*
- * next_zone - helper magic for for_each_zone()
- * Thanks to William Lee Irwin III for this piece of ingenuity.
- */
-static inline struct zone *next_zone(struct zone *zone)
-{
-       pg_data_t *pgdat = zone->zone_pgdat;
-
-       if (zone < pgdat->node_zones + MAX_NR_ZONES - 1)
-               zone++;
-       else {
-               pgdat = next_online_pgdat(pgdat);
-               if (pgdat)
-                       zone = pgdat->node_zones;
-               else
-                       zone = NULL;
-       }
-       return zone;
-}
-
 /**
  * for_each_zone - helper macro to iterate over all memory zones
  * @zone - pointer to struct zone variable