gfp.h 497 B

1234567891011121314151617
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _TOOLS_INCLUDE_LINUX_GFP_H
  3. #define _TOOLS_INCLUDE_LINUX_GFP_H
  4. #include <linux/types.h>
  5. #include <linux/gfp_types.h>
  6. /* Helper macro to avoid gfp flags if they are the default one */
  7. #define __default_gfp(a,...) a
  8. #define default_gfp(...) __default_gfp(__VA_ARGS__ __VA_OPT__(,) GFP_KERNEL)
  9. static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
  10. {
  11. return !!(gfp_flags & __GFP_DIRECT_RECLAIM);
  12. }
  13. #endif /* _TOOLS_INCLUDE_LINUX_GFP_H */