summaryrefslogtreecommitdiffstats
path: root/tools/testing/radix-tree/linux/mempool.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/radix-tree/linux/mempool.h')
-rw-r--r--tools/testing/radix-tree/linux/mempool.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/radix-tree/linux/mempool.h b/tools/testing/radix-tree/linux/mempool.h
new file mode 100644
index 0000000..6a2dc55
--- /dev/null
+++ b/tools/testing/radix-tree/linux/mempool.h
@@ -0,0 +1,16 @@
+
+#include <linux/slab.h>
+
+typedef void *(mempool_alloc_t)(int gfp_mask, void *pool_data);
+typedef void (mempool_free_t)(void *element, void *pool_data);
+
+typedef struct {
+ mempool_alloc_t *alloc;
+ mempool_free_t *free;
+ void *data;
+} mempool_t;
+
+void *mempool_alloc(mempool_t *pool, int gfp_mask);
+void mempool_free(void *element, mempool_t *pool);
+mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
+ mempool_free_t *free_fn, void *pool_data);
OpenPOWER on IntegriCloud