]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - tools/testing/radix-tree/test.h
radix tree test suite: check multiorder iteration
[mirror_ubuntu-bionic-kernel.git] / tools / testing / radix-tree / test.h
CommitLineData
1366c37e
MW
1#include <linux/gfp.h>
2#include <linux/types.h>
3#include <linux/radix-tree.h>
4#include <linux/rcupdate.h>
5
6struct item {
7 unsigned long index;
101d9607 8 unsigned int order;
1366c37e
MW
9};
10
101d9607
MW
11struct item *item_create(unsigned long index, unsigned int order);
12int __item_insert(struct radix_tree_root *root, struct item *item);
1366c37e 13int item_insert(struct radix_tree_root *root, unsigned long index);
4f3755d1
MW
14int item_insert_order(struct radix_tree_root *root, unsigned long index,
15 unsigned order);
1366c37e
MW
16int item_delete(struct radix_tree_root *root, unsigned long index);
17struct item *item_lookup(struct radix_tree_root *root, unsigned long index);
18
19void item_check_present(struct radix_tree_root *root, unsigned long index);
20void item_check_absent(struct radix_tree_root *root, unsigned long index);
21void item_gang_check_present(struct radix_tree_root *root,
22 unsigned long start, unsigned long nr,
23 int chunk, int hop);
24void item_full_scan(struct radix_tree_root *root, unsigned long start,
25 unsigned long nr, int chunk);
26void item_kill_tree(struct radix_tree_root *root);
27
268f42de
MW
28int tag_tagged_items(struct radix_tree_root *, pthread_mutex_t *,
29 unsigned long start, unsigned long end, unsigned batch,
30 unsigned iftag, unsigned thentag);
478922e2
MW
31unsigned long find_item(struct radix_tree_root *, void *item);
32
1366c37e 33void tag_check(void);
4f3755d1 34void multiorder_checks(void);
3e3cdc68 35void iteration_test(unsigned order, unsigned duration);
cfa40bcf 36void benchmark(void);
1366c37e
MW
37
38struct item *
39item_tag_set(struct radix_tree_root *root, unsigned long index, int tag);
40struct item *
41item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag);
42int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag);
43void tree_verify_min_height(struct radix_tree_root *root, int maxindex);
44void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag);
45
46extern int nr_allocated;
47
48/* Normally private parts of lib/radix-tree.c */
148deab2 49struct radix_tree_node *entry_to_node(void *ptr);
0796c583 50void radix_tree_dump(struct radix_tree_root *root);
1366c37e 51int root_tag_get(struct radix_tree_root *root, unsigned int tag);
0694f0c9
MW
52unsigned long node_maxindex(struct radix_tree_node *);
53unsigned long shift_maxindex(unsigned int shift);
6df5ee78 54int radix_tree_cpu_dead(unsigned int cpu);
2791653a
MW
55struct radix_tree_preload {
56 unsigned nr;
57 struct radix_tree_node *nodes;
58};
59extern struct radix_tree_preload radix_tree_preloads;