diff options
Diffstat (limited to 'include/linux/gfp.h')
-rw-r--r-- | include/linux/gfp.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index da8aa872eb6e..f8ffcd401c5f 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -48,9 +48,10 @@ struct vm_area_struct; | |||
48 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ | 48 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ |
49 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ | 49 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ |
50 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | 50 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ |
51 | #define __GFP_MOVABLE ((__force gfp_t)0x80000u) /* Page is movable */ | 51 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ |
52 | #define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */ | ||
52 | 53 | ||
53 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 54 | #define __GFP_BITS_SHIFT 21 /* Room for 21 __GFP_FOO bits */ |
54 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 55 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
55 | 56 | ||
56 | /* This equals 0, but use constants in case they ever change */ | 57 | /* This equals 0, but use constants in case they ever change */ |
@@ -60,6 +61,8 @@ struct vm_area_struct; | |||
60 | #define GFP_NOIO (__GFP_WAIT) | 61 | #define GFP_NOIO (__GFP_WAIT) |
61 | #define GFP_NOFS (__GFP_WAIT | __GFP_IO) | 62 | #define GFP_NOFS (__GFP_WAIT | __GFP_IO) |
62 | #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) | 63 | #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) |
64 | #define GFP_TEMPORARY (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
65 | __GFP_RECLAIMABLE) | ||
63 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) | 66 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) |
64 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ | 67 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ |
65 | __GFP_HIGHMEM) | 68 | __GFP_HIGHMEM) |
@@ -80,7 +83,7 @@ struct vm_area_struct; | |||
80 | #endif | 83 | #endif |
81 | 84 | ||
82 | /* This mask makes up all the page movable related flags */ | 85 | /* This mask makes up all the page movable related flags */ |
83 | #define GFP_MOVABLE_MASK (__GFP_MOVABLE) | 86 | #define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE) |
84 | 87 | ||
85 | /* Control page allocator reclaim behavior */ | 88 | /* Control page allocator reclaim behavior */ |
86 | #define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ | 89 | #define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ |
@@ -129,6 +132,12 @@ static inline enum zone_type gfp_zone(gfp_t flags) | |||
129 | return base + ZONE_NORMAL; | 132 | return base + ZONE_NORMAL; |
130 | } | 133 | } |
131 | 134 | ||
135 | static inline gfp_t set_migrateflags(gfp_t gfp, gfp_t migrate_flags) | ||
136 | { | ||
137 | BUG_ON((gfp & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK); | ||
138 | return (gfp & ~(GFP_MOVABLE_MASK)) | migrate_flags; | ||
139 | } | ||
140 | |||
132 | /* | 141 | /* |
133 | * There is only one page-allocator function, and two main namespaces to | 142 | * There is only one page-allocator function, and two main namespaces to |
134 | * it. The alloc_page*() variants return 'struct page *' and as such | 143 | * it. The alloc_page*() variants return 'struct page *' and as such |