diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2016-12-16 15:12:41 -0500 |
---|---|---|
committer | Matthew Wilcox <mawilcox@microsoft.com> | 2017-02-13 16:09:36 -0500 |
commit | a3c7890790e742074bc9e5640b0fcf9c61a771a2 (patch) | |
tree | 6fecc34c15dc3a5ad04c80105575bde9393815e7 /tools | |
parent | 43a30c2a3171e0f92c28dfd31ca3eb7d9cc72b26 (diff) |
radix tree test suite: Remove mempool
The radix tree hasn't used a mempool since the beginning of git history.
Remove the userspace mempool implementation.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Rehas Sachdeva <aquannie@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/radix-tree/linux.c | 22 | ||||
-rw-r--r-- | tools/testing/radix-tree/linux/mempool.h | 16 |
2 files changed, 0 insertions, 38 deletions
diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c index d31ea7c9abec..c27c11261c37 100644 --- a/tools/testing/radix-tree/linux.c +++ b/tools/testing/radix-tree/linux.c | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | #include <assert.h> | 6 | #include <assert.h> |
7 | 7 | ||
8 | #include <linux/mempool.h> | ||
9 | #include <linux/poison.h> | 8 | #include <linux/poison.h> |
10 | #include <linux/slab.h> | 9 | #include <linux/slab.h> |
11 | #include <linux/radix-tree.h> | 10 | #include <linux/radix-tree.h> |
@@ -22,27 +21,6 @@ struct kmem_cache { | |||
22 | void (*ctor)(void *); | 21 | void (*ctor)(void *); |
23 | }; | 22 | }; |
24 | 23 | ||
25 | void *mempool_alloc(mempool_t *pool, int gfp_mask) | ||
26 | { | ||
27 | return pool->alloc(gfp_mask, pool->data); | ||
28 | } | ||
29 | |||
30 | void mempool_free(void *element, mempool_t *pool) | ||
31 | { | ||
32 | pool->free(element, pool->data); | ||
33 | } | ||
34 | |||
35 | mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, | ||
36 | mempool_free_t *free_fn, void *pool_data) | ||
37 | { | ||
38 | mempool_t *ret = malloc(sizeof(*ret)); | ||
39 | |||
40 | ret->alloc = alloc_fn; | ||
41 | ret->free = free_fn; | ||
42 | ret->data = pool_data; | ||
43 | return ret; | ||
44 | } | ||
45 | |||
46 | void *kmem_cache_alloc(struct kmem_cache *cachep, int flags) | 24 | void *kmem_cache_alloc(struct kmem_cache *cachep, int flags) |
47 | { | 25 | { |
48 | struct radix_tree_node *node; | 26 | struct radix_tree_node *node; |
diff --git a/tools/testing/radix-tree/linux/mempool.h b/tools/testing/radix-tree/linux/mempool.h deleted file mode 100644 index 6a2dc55b41d6..000000000000 --- a/tools/testing/radix-tree/linux/mempool.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | |||
2 | #include <linux/slab.h> | ||
3 | |||
4 | typedef void *(mempool_alloc_t)(int gfp_mask, void *pool_data); | ||
5 | typedef void (mempool_free_t)(void *element, void *pool_data); | ||
6 | |||
7 | typedef struct { | ||
8 | mempool_alloc_t *alloc; | ||
9 | mempool_free_t *free; | ||
10 | void *data; | ||
11 | } mempool_t; | ||
12 | |||
13 | void *mempool_alloc(mempool_t *pool, int gfp_mask); | ||
14 | void mempool_free(void *element, mempool_t *pool); | ||
15 | mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, | ||
16 | mempool_free_t *free_fn, void *pool_data); | ||