aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/radix-tree/linux/slab.h
diff options
context:
space:
mode:
authorMatthew Wilcox <mawilcox@microsoft.com>2018-02-25 06:00:11 -0500
committerMatthew Wilcox <mawilcox@microsoft.com>2018-02-25 06:00:11 -0500
commit3d4d5d618639c3155cfce57101d619a0935434d2 (patch)
treebef6b1ef33eef7f153721e832bea45143481486d /tools/testing/radix-tree/linux/slab.h
parentMerge tag 'powerpc-4.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux (diff)
downloadlinux-dev-3d4d5d618639c3155cfce57101d619a0935434d2.tar.xz
linux-dev-3d4d5d618639c3155cfce57101d619a0935434d2.zip
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 '')
-rw-r--r--tools/testing/radix-tree/linux/slab.h6
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);