1c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/****************************************************************************
2c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ****************************************************************************
3c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ***
4c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ***   This header was automatically generated from a Linux kernel header
5c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ***   of the same name, to make information necessary for userspace to
6c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ***   call into the kernel available to libc.  It contains only constants,
7c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ***   structures, and macros generated from the original header, and thus,
8c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ***   contains no copyrightable information.
9c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ***
10c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ****************************************************************************
11c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ****************************************************************************/
12c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifndef _LINUX_MEMPOOL_H
13c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define _LINUX_MEMPOOL_H
14c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner
15c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#include <linux/wait.h>
16c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner
17c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerstruct kmem_cache;
18c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner
19c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data);
20c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef void (mempool_free_t)(void *element, void *pool_data);
21c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner
22c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef struct mempool_s {
23c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner spinlock_t lock;
24c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner int min_nr;
25c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner int curr_nr;
26c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner void **elements;
27c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner
28c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner void *pool_data;
29c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner mempool_alloc_t *alloc;
30c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner mempool_free_t *free;
31c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner wait_queue_head_t wait;
32c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner} mempool_t;
33c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner
34c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif
35