#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/mempool.h>
#include <linux/blkdev.h>
#include <linux/writeback.h>
Go to the source code of this file.
|
void | mempool_destroy (mempool_t *pool) |
|
| EXPORT_SYMBOL (mempool_destroy) |
|
mempool_t * | mempool_create (int min_nr, mempool_alloc_t *alloc_fn, mempool_free_t *free_fn, void *pool_data) |
|
| EXPORT_SYMBOL (mempool_create) |
|
mempool_t * | mempool_create_node (int min_nr, mempool_alloc_t *alloc_fn, mempool_free_t *free_fn, void *pool_data, gfp_t gfp_mask, int node_id) |
|
| EXPORT_SYMBOL (mempool_create_node) |
|
int | mempool_resize (mempool_t *pool, int new_min_nr, gfp_t gfp_mask) |
|
| EXPORT_SYMBOL (mempool_resize) |
|
void * | mempool_alloc (mempool_t *pool, gfp_t gfp_mask) |
|
| EXPORT_SYMBOL (mempool_alloc) |
|
void | mempool_free (void *element, mempool_t *pool) |
|
| EXPORT_SYMBOL (mempool_free) |
|
void * | mempool_alloc_slab (gfp_t gfp_mask, void *pool_data) |
|
| EXPORT_SYMBOL (mempool_alloc_slab) |
|
void | mempool_free_slab (void *element, void *pool_data) |
|
| EXPORT_SYMBOL (mempool_free_slab) |
|
void * | mempool_kmalloc (gfp_t gfp_mask, void *pool_data) |
|
| EXPORT_SYMBOL (mempool_kmalloc) |
|
void | mempool_kfree (void *element, void *pool_data) |
|
| EXPORT_SYMBOL (mempool_kfree) |
|
void * | mempool_alloc_pages (gfp_t gfp_mask, void *pool_data) |
|
| EXPORT_SYMBOL (mempool_alloc_pages) |
|
void | mempool_free_pages (void *element, void *pool_data) |
|
| EXPORT_SYMBOL (mempool_free_pages) |
|
mempool_alloc - allocate an element from a specific memory pool : pointer to the memory pool which was allocated via mempool_create(). : the usual allocation bitmask.
this function only sleeps if the alloc_fn() function sleeps or returns NULL. Note that due to preallocation, this function never fails when called from process contexts. (it might fail if called from an IRQ context.)
Definition at line 196 of file mempool.c.
mempool_create - create a memory pool : the minimum number of elements guaranteed to be allocated for this pool. : user-defined element-allocation function. : user-defined element-freeing function. : optional private data available to the user-defined functions.
this function creates and allocates a guaranteed size, preallocated memory pool. The pool can be used from the mempool_alloc() and mempool_free() functions. This function might sleep. Both the alloc_fn() and the free_fn() functions might sleep - as long as the mempool_alloc() function is not called from IRQ contexts.
Definition at line 63 of file mempool.c.
mempool_destroy - deallocate a memory pool : pointer to the memory pool which was allocated via mempool_create().
Free all reserved elements in and itself. This function only sleeps if the free_fn() function sleeps.
Definition at line 38 of file mempool.c.
void mempool_free_pages |
( |
void * |
element, |
|
|
void * |
pool_data |
|
) |
| |
mempool_resize - resize an existing memory pool : pointer to the memory pool which was allocated via mempool_create(). : the new minimum number of elements guaranteed to be allocated for this pool. : the usual allocation bitmask.
This function shrinks/grows the pool. In the case of growing, it cannot be guaranteed that the pool will be grown to the new size immediately, but new mempool_free() calls will refill it.
Note, the caller must guarantee that no mempool_destroy is called while this function is running. mempool_alloc() & mempool_free() might be called (eg. from IRQ contexts) while this function executes.
Definition at line 125 of file mempool.c.