diff options
Diffstat (limited to 'include/linux/gfp.h')
-rw-r--r-- | include/linux/gfp.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 313dfe9b443a..8b2eab90abb6 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -11,7 +11,7 @@ struct vm_area_struct; | |||
11 | /* | 11 | /* |
12 | * GFP bitmasks.. | 12 | * GFP bitmasks.. |
13 | */ | 13 | */ |
14 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ | 14 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */ |
15 | #define __GFP_DMA ((__force gfp_t)0x01u) | 15 | #define __GFP_DMA ((__force gfp_t)0x01u) |
16 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) | 16 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) |
17 | #ifdef CONFIG_DMA_IS_DMA32 | 17 | #ifdef CONFIG_DMA_IS_DMA32 |
@@ -74,7 +74,12 @@ struct vm_area_struct; | |||
74 | #define GFP_DMA32 __GFP_DMA32 | 74 | #define GFP_DMA32 __GFP_DMA32 |
75 | 75 | ||
76 | 76 | ||
77 | #define gfp_zone(mask) ((__force int)((mask) & (__force gfp_t)GFP_ZONEMASK)) | 77 | static inline int gfp_zone(gfp_t gfp) |
78 | { | ||
79 | int zone = GFP_ZONEMASK & (__force int) gfp; | ||
80 | BUG_ON(zone >= GFP_ZONETYPES); | ||
81 | return zone; | ||
82 | } | ||
78 | 83 | ||
79 | /* | 84 | /* |
80 | * There is only one page-allocator function, and two main namespaces to | 85 | * There is only one page-allocator function, and two main namespaces to |