diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2018-02-25 14:00:11 +0300 |
---|---|---|
committer | Matthew Wilcox <mawilcox@microsoft.com> | 2018-02-25 14:00:11 +0300 |
commit | 3d4d5d618639c3155cfce57101d619a0935434d2 (patch) | |
tree | bef6b1ef33eef7f153721e832bea45143481486d /tools/testing/radix-tree/linux/slab.h | |
parent | 3664ce2d930983966d2aac0e167f1332988c4e25 (diff) | |
download | linux-3d4d5d618639c3155cfce57101d619a0935434d2.tar.xz |
radix tree test suite: Fix build
- Add an empty linux/compiler_types.h (now being included by kconfig.h)
- Add __GFP_ZERO
- Add kzalloc
- Test __GFP_DIRECT_RECLAIM instead of __GFP_NOWARN
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'tools/testing/radix-tree/linux/slab.h')
-rw-r--r-- | tools/testing/radix-tree/linux/slab.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/radix-tree/linux/slab.h b/tools/testing/radix-tree/linux/slab.h index 979baeec7e70..a037def0dec6 100644 --- a/tools/testing/radix-tree/linux/slab.h +++ b/tools/testing/radix-tree/linux/slab.h @@ -3,6 +3,7 @@ #define SLAB_H #include <linux/types.h> +#include <linux/gfp.h> #define SLAB_HWCACHE_ALIGN 1 #define SLAB_PANIC 2 @@ -11,6 +12,11 @@ void *kmalloc(size_t size, gfp_t); void kfree(void *); +static inline void *kzalloc(size_t size, gfp_t gfp) +{ + return kmalloc(size, gfp | __GFP_ZERO); +} + void *kmem_cache_alloc(struct kmem_cache *cachep, int flags); void kmem_cache_free(struct kmem_cache *cachep, void *objp); |