diff options
Diffstat (limited to 'tools/testing/radix-tree/linux/gfp.h')
-rw-r--r-- | tools/testing/radix-tree/linux/gfp.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/tools/testing/radix-tree/linux/gfp.h b/tools/testing/radix-tree/linux/gfp.h index 5201b915f631..5b09b2ce6c33 100644 --- a/tools/testing/radix-tree/linux/gfp.h +++ b/tools/testing/radix-tree/linux/gfp.h | |||
@@ -3,8 +3,24 @@ | |||
3 | 3 | ||
4 | #define __GFP_BITS_SHIFT 26 | 4 | #define __GFP_BITS_SHIFT 26 |
5 | #define __GFP_BITS_MASK ((gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 5 | #define __GFP_BITS_MASK ((gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
6 | #define __GFP_WAIT 1 | 6 | |
7 | #define __GFP_ACCOUNT 0 | 7 | #define __GFP_HIGH 0x20u |
8 | #define __GFP_NOWARN 0 | 8 | #define __GFP_IO 0x40u |
9 | #define __GFP_FS 0x80u | ||
10 | #define __GFP_NOWARN 0x200u | ||
11 | #define __GFP_ATOMIC 0x80000u | ||
12 | #define __GFP_ACCOUNT 0x100000u | ||
13 | #define __GFP_DIRECT_RECLAIM 0x400000u | ||
14 | #define __GFP_KSWAPD_RECLAIM 0x2000000u | ||
15 | |||
16 | #define __GFP_RECLAIM (__GFP_DIRECT_RECLAIM|__GFP_KSWAPD_RECLAIM) | ||
17 | |||
18 | #define GFP_ATOMIC (__GFP_HIGH|__GFP_ATOMIC|__GFP_KSWAPD_RECLAIM) | ||
19 | #define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS) | ||
20 | |||
21 | static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags) | ||
22 | { | ||
23 | return !!(gfp_flags & __GFP_DIRECT_RECLAIM); | ||
24 | } | ||
9 | 25 | ||
10 | #endif | 26 | #endif |