mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
43a30c2a31
commit
a3c7890790
|
@ -5,7 +5,6 @@
|
|||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <linux/mempool.h>
|
||||
#include <linux/poison.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/radix-tree.h>
|
||||
|
@ -22,27 +21,6 @@ struct kmem_cache {
|
|||
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)
|
||||
{
|
||||
struct radix_tree_node *node;
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
#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);
|
Loading…
Reference in New Issue