1
2#include <linux/gfp.h>
3#include <linux/types.h>
4#include <linux/radix-tree.h>
5#include <linux/rcupdate.h>
6
7struct item {
8 struct rcu_head rcu_head;
9 unsigned long index;
10 unsigned int order;
11};
12
13struct item *item_create(unsigned long index, unsigned int order);
14int item_insert(struct radix_tree_root *root, unsigned long index);
15void item_sanity(struct item *item, unsigned long index);
16void item_free(struct item *item, unsigned long index);
17int item_delete(struct radix_tree_root *root, unsigned long index);
18int item_delete_rcu(struct xarray *xa, unsigned long index);
19struct item *item_lookup(struct radix_tree_root *root, unsigned long index);
20
21void item_check_present(struct radix_tree_root *root, unsigned long index);
22void item_check_absent(struct radix_tree_root *root, unsigned long index);
23void item_gang_check_present(struct radix_tree_root *root,
24 unsigned long start, unsigned long nr,
25 int chunk, int hop);
26void item_full_scan(struct radix_tree_root *root, unsigned long start,
27 unsigned long nr, int chunk);
28void item_kill_tree(struct radix_tree_root *root);
29
30int tag_tagged_items(struct xarray *, unsigned long start, unsigned long end,
31 unsigned batch, xa_mark_t iftag, xa_mark_t thentag);
32
33void xarray_tests(void);
34void tag_check(void);
35void multiorder_checks(void);
36void iteration_test(unsigned order, unsigned duration);
37void benchmark(void);
38void idr_checks(void);
39void ida_tests(void);
40
41struct item *
42item_tag_set(struct radix_tree_root *root, unsigned long index, int tag);
43struct item *
44item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag);
45int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag);
46void tree_verify_min_height(struct radix_tree_root *root, int maxindex);
47void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag);
48
49extern int nr_allocated;
50
51
52struct radix_tree_node *entry_to_node(void *ptr);
53void radix_tree_dump(struct radix_tree_root *root);
54int root_tag_get(struct radix_tree_root *root, unsigned int tag);
55unsigned long node_maxindex(struct radix_tree_node *);
56unsigned long shift_maxindex(unsigned int shift);
57int radix_tree_cpu_dead(unsigned int cpu);
58struct radix_tree_preload {
59 unsigned nr;
60 struct radix_tree_node *nodes;
61};
62extern struct radix_tree_preload radix_tree_preloads;
63