Merge tag 'iio-fixes-for-4.0a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
[firefly-linux-kernel-4.4.55.git] / mm / internal.h
index efad241f7014805fbe39ae30f1e4c03a6046cfa6..a96da5b0029dc4a2837f558534f436990ef42894 100644 (file)
@@ -109,6 +109,28 @@ extern pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long address);
  * in mm/page_alloc.c
  */
 
+/*
+ * Structure for holding the mostly immutable allocation parameters passed
+ * between functions involved in allocations, including the alloc_pages*
+ * family of functions.
+ *
+ * nodemask, migratetype and high_zoneidx are initialized only once in
+ * __alloc_pages_nodemask() and then never change.
+ *
+ * zonelist, preferred_zone and classzone_idx are set first in
+ * __alloc_pages_nodemask() for the fast path, and might be later changed
+ * in __alloc_pages_slowpath(). All other functions pass the whole strucure
+ * by a const pointer.
+ */
+struct alloc_context {
+       struct zonelist *zonelist;
+       nodemask_t *nodemask;
+       struct zone *preferred_zone;
+       int classzone_idx;
+       int migratetype;
+       enum zone_type high_zoneidx;
+};
+
 /*
  * Locate the struct page for both the matching buddy in our
  * pair (buddy1) and the combined O(n+1) page they form (page).
@@ -329,8 +351,10 @@ extern int mminit_loglevel;
 #define mminit_dprintk(level, prefix, fmt, arg...) \
 do { \
        if (level < mminit_loglevel) { \
-               printk(level <= MMINIT_WARNING ? KERN_WARNING : KERN_DEBUG); \
-               printk(KERN_CONT "mminit::" prefix " " fmt, ##arg); \
+               if (level <= MMINIT_WARNING) \
+                       printk(KERN_WARNING "mminit::" prefix " " fmt, ##arg); \
+               else \
+                       printk(KERN_DEBUG "mminit::" prefix " " fmt, ##arg); \
        } \
 } while (0)