Commit a3c78907 authored by Matthew Wilcox's avatar Matthew Wilcox

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: default avatarMatthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: default avatarRehas Sachdeva <aquannie@gmail.com>
parent 43a30c2a
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <unistd.h> #include <unistd.h>
#include <assert.h> #include <assert.h>
#include <linux/mempool.h>
#include <linux/poison.h> #include <linux/poison.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/radix-tree.h> #include <linux/radix-tree.h>
...@@ -22,27 +21,6 @@ struct kmem_cache { ...@@ -22,27 +21,6 @@ struct kmem_cache {
void (*ctor)(void *); void (*ctor)(void *);
}; };
void *mempool_alloc(mempool_t *pool, int gfp_mask)
{
return pool->alloc(gfp_mask, pool->data);
}
void mempool_free(void *element, mempool_t *pool)
{
pool->free(element, pool->data);
}
mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
mempool_free_t *free_fn, void *pool_data)
{
mempool_t *ret = malloc(sizeof(*ret));
ret->alloc = alloc_fn;
ret->free = free_fn;
ret->data = pool_data;
return ret;
}
void *kmem_cache_alloc(struct kmem_cache *cachep, int flags) void *kmem_cache_alloc(struct kmem_cache *cachep, int flags)
{ {
struct radix_tree_node *node; struct radix_tree_node *node;
......
#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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment