diff options
author | Matthew Wilcox <willy@linux.intel.com> | 2016-03-17 17:21:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-17 18:09:34 -0400 |
commit | 1366c37ed84b166a0fffe201154b0d3b78a3976b (patch) | |
tree | 3a688edaf09069694db90421f200568b886a4295 /tools/testing/radix-tree/linux/mempool.h | |
parent | f67c07f07fca95a7f330b8bb928eabaf9fcce75d (diff) |
radix tree test harness
This code is mostly from Andrew Morton and Nick Piggin; tarball downloaded
from http://ozlabs.org/~akpm/rtth.tar.gz with sha1sum
0ce679db9ec047296b5d1ff7a1dfaa03a7bef1bd
Some small modifications were necessary to the test harness to fix the
build with the current Linux source code.
I also made minor modifications to automatically test the radix-tree.c
and radix-tree.h files that are in the current source tree, as opposed
to a copied and slightly modified version. I am sure more could be done
to tidy up the harness, as well as adding more tests.
[koct9i@gmail.com: fix compilation]
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/radix-tree/linux/mempool.h')
-rw-r--r-- | tools/testing/radix-tree/linux/mempool.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/radix-tree/linux/mempool.h b/tools/testing/radix-tree/linux/mempool.h new file mode 100644 index 000000000000..6a2dc55b41d6 --- /dev/null +++ b/tools/testing/radix-tree/linux/mempool.h | |||
@@ -0,0 +1,16 @@ | |||
1 | |||
2 | #include <linux/slab.h> | ||
3 | |||
4 | typedef void *(mempool_alloc_t)(int gfp_mask, void *pool_data); | ||
5 | typedef void (mempool_free_t)(void *element, void *pool_data); | ||
6 | |||
7 | typedef struct { | ||
8 | mempool_alloc_t *alloc; | ||
9 | mempool_free_t *free; | ||
10 | void *data; | ||
11 | } mempool_t; | ||
12 | |||
13 | void *mempool_alloc(mempool_t *pool, int gfp_mask); | ||
14 | void mempool_free(void *element, mempool_t *pool); | ||
15 | mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, | ||
16 | mempool_free_t *free_fn, void *pool_data); | ||