License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6-block.git] / tools / testing / radix-tree / linux / gfp.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1366c37e
MW
2#ifndef _GFP_H
3#define _GFP_H
4
12ea6539
MW
5#include <linux/types.h>
6
117dec97 7#define __GFP_BITS_SHIFT 26
1366c37e 8#define __GFP_BITS_MASK ((gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
31023cd6
MW
9
10#define __GFP_HIGH 0x20u
11#define __GFP_IO 0x40u
12#define __GFP_FS 0x80u
13#define __GFP_NOWARN 0x200u
14#define __GFP_ATOMIC 0x80000u
15#define __GFP_ACCOUNT 0x100000u
16#define __GFP_DIRECT_RECLAIM 0x400000u
17#define __GFP_KSWAPD_RECLAIM 0x2000000u
18
0a835c4f
MW
19#define __GFP_RECLAIM (__GFP_DIRECT_RECLAIM|__GFP_KSWAPD_RECLAIM)
20
21#define GFP_ATOMIC (__GFP_HIGH|__GFP_ATOMIC|__GFP_KSWAPD_RECLAIM)
22#define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS)
23#define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM)
31023cd6 24
31023cd6
MW
25
26static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
27{
28 return !!(gfp_flags & __GFP_DIRECT_RECLAIM);
29}
1366c37e
MW
30
31#endif