Messages in this thread Patch in this message | | | Subject | [patch 7/8] mempool - Add mempool_create_slab_pool() | From | Matthew Dobson <> | Date | Mon, 30 Jan 2006 13:24:05 -0800 |
| |
plain text document attachment (mempool-add_mempool_create_slab_pool.patch) Create a simple wrapper function for the common case of creating a slab-based mempool.
Signed-off-by: Matthew Dobson <colpatch@us.ibm.com>
include/linux/mempool.h | 5 +++++ 1 files changed, 5 insertions(+)
Index: linux-2.6.16-rc1-mm4+mempool_work/include/linux/mempool.h =================================================================== --- linux-2.6.16-rc1-mm4+mempool_work.orig/include/linux/mempool.h +++ linux-2.6.16-rc1-mm4+mempool_work/include/linux/mempool.h @@ -37,6 +37,11 @@ extern void mempool_free(void *element, */ void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); void mempool_free_slab(void *element, void *pool_data); +static inline mempool_t *mempool_create_slab_pool(int min_nr, kmem_cache_t *kc) +{ + return mempool_create(min_nr, mempool_alloc_slab, mempool_free_slab, + (void *) kc); +} /* * 2 mempool_alloc_t's and a mempool_free_t to kmalloc/kzalloc and kfree --
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |