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.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 2a2153ebfe0b..a0992d392d79 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -85,6 +85,21 @@ static inline int gfp_zone(gfp_t gfp)
85 return zone; 85 return zone;
86} 86}
87 87
88static inline enum zone_type highest_zone(gfp_t flags)
89{
90 if (flags & __GFP_DMA)
91 return ZONE_DMA;
92#ifdef CONFIG_ZONE_DMA32
93 if (flags & __GFP_DMA32)
94 return ZONE_DMA32;
95#endif
96#ifdef CONFIG_HIGHMEM
97 if (flags & __GFP_HIGHMEM)
98 return ZONE_HIGHMEM;
99#endif
100 return ZONE_NORMAL;
101}
102
88/* 103/*
89 * There is only one page-allocator function, and two main namespaces to 104 * There is only one page-allocator function, and two main namespaces to
90 * it. The alloc_page*() variants return 'struct page *' and as such 105 * it. The alloc_page*() variants return 'struct page *' and as such