aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gfp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/gfp.h')
-rw-r--r--include/linux/gfp.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index bc68dd9a6d41..12a90a191c11 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -98,22 +98,29 @@ struct vm_area_struct;
98 98
99static inline enum zone_type gfp_zone(gfp_t flags) 99static inline enum zone_type gfp_zone(gfp_t flags)
100{ 100{
101 int base = 0;
102
103#ifdef CONFIG_NUMA
104 if (flags & __GFP_THISNODE)
105 base = MAX_NR_ZONES;
106#endif
107
101#ifdef CONFIG_ZONE_DMA 108#ifdef CONFIG_ZONE_DMA
102 if (flags & __GFP_DMA) 109 if (flags & __GFP_DMA)
103 return ZONE_DMA; 110 return base + ZONE_DMA;
104#endif 111#endif
105#ifdef CONFIG_ZONE_DMA32 112#ifdef CONFIG_ZONE_DMA32
106 if (flags & __GFP_DMA32) 113 if (flags & __GFP_DMA32)
107 return ZONE_DMA32; 114 return base + ZONE_DMA32;
108#endif 115#endif
109 if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == 116 if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) ==
110 (__GFP_HIGHMEM | __GFP_MOVABLE)) 117 (__GFP_HIGHMEM | __GFP_MOVABLE))
111 return ZONE_MOVABLE; 118 return base + ZONE_MOVABLE;
112#ifdef CONFIG_HIGHMEM 119#ifdef CONFIG_HIGHMEM
113 if (flags & __GFP_HIGHMEM) 120 if (flags & __GFP_HIGHMEM)
114 return ZONE_HIGHMEM; 121 return base + ZONE_HIGHMEM;
115#endif 122#endif
116 return ZONE_NORMAL; 123 return base + ZONE_NORMAL;
117} 124}
118 125
119/* 126/*