diff options
Diffstat (limited to 'include/linux/mempool.h')
-rw-r--r-- | include/linux/mempool.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mempool.h b/include/linux/mempool.h index 41570ce353eb..9be484d11283 100644 --- a/include/linux/mempool.h +++ b/include/linux/mempool.h | |||
@@ -6,6 +6,8 @@ | |||
6 | 6 | ||
7 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
8 | 8 | ||
9 | struct kmem_cache; | ||
10 | |||
9 | typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data); | 11 | typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data); |
10 | typedef void (mempool_free_t)(void *element, void *pool_data); | 12 | typedef void (mempool_free_t)(void *element, void *pool_data); |
11 | 13 | ||
@@ -37,6 +39,12 @@ extern void mempool_free(void *element, mempool_t *pool); | |||
37 | */ | 39 | */ |
38 | void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); | 40 | void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); |
39 | void mempool_free_slab(void *element, void *pool_data); | 41 | void mempool_free_slab(void *element, void *pool_data); |
42 | static inline mempool_t * | ||
43 | mempool_create_slab_pool(int min_nr, struct kmem_cache *kc) | ||
44 | { | ||
45 | return mempool_create(min_nr, mempool_alloc_slab, mempool_free_slab, | ||
46 | (void *) kc); | ||
47 | } | ||
40 | 48 | ||
41 | /* | 49 | /* |
42 | * 2 mempool_alloc_t's and a mempool_free_t to kmalloc/kzalloc and kfree | 50 | * 2 mempool_alloc_t's and a mempool_free_t to kmalloc/kzalloc and kfree |