mirror of
https://github.com/torvalds/linux.git
synced 2026-11-09 13:44:03 +01:00
mm: Move default_gfp() into gfp_types.h
Using default_gfp() only depends on the GFP_KERNEL value. Move default_gfp() into gfp_types.h so that future use in devres.h doesn't require pulling in all of gfp.h. Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Reviewed-by: Zi Yan <ziy@nvidia.com> Link: https://patch.msgid.link/20260914223219.901347-1-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
This commit is contained in:
parent
0f82b48209
commit
ff566742e9
|
|
@ -13,10 +13,6 @@
|
|||
struct vm_area_struct;
|
||||
struct mempolicy;
|
||||
|
||||
/* Helper macro to avoid gfp flags if they are the default one */
|
||||
#define __default_gfp(a,b,...) b
|
||||
#define default_gfp(...) __default_gfp(,##__VA_ARGS__,GFP_KERNEL)
|
||||
|
||||
static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
|
||||
{
|
||||
return !!(gfp_flags & __GFP_DIRECT_RECLAIM);
|
||||
|
|
|
|||
|
|
@ -382,4 +382,8 @@ enum {
|
|||
__GFP_NOMEMALLOC | __GFP_NOWARN) & ~__GFP_RECLAIM)
|
||||
#define GFP_TRANSHUGE (GFP_TRANSHUGE_LIGHT | __GFP_DIRECT_RECLAIM)
|
||||
|
||||
/* Helper macro to avoid gfp flags if they are the default one */
|
||||
#define __default_gfp(a,b,...) b
|
||||
#define default_gfp(...) __default_gfp(,##__VA_ARGS__,GFP_KERNEL)
|
||||
|
||||
#endif /* __LINUX_GFP_TYPES_H */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user