blob: 5b09b2ce6c33ad0e732a70e65347258e00f5a741 [file] [log] [blame]
Matthew Wilcox1366c372016-03-17 14:21:45 -07001#ifndef _GFP_H
2#define _GFP_H
3
Valdis Kletnieks117dec92016-08-02 14:02:28 -07004#define __GFP_BITS_SHIFT 26
Matthew Wilcox1366c372016-03-17 14:21:45 -07005#define __GFP_BITS_MASK ((gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
Matthew Wilcox31023cd2016-12-14 15:07:59 -08006
7#define __GFP_HIGH 0x20u
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
21static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
22{
23 return !!(gfp_flags & __GFP_DIRECT_RECLAIM);
24}
Matthew Wilcox1366c372016-03-17 14:21:45 -070025
26#endif