]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1366c37e MW |
2 | #include <linux/gfp.h> |
3 | #include <linux/types.h> | |
4 | #include <linux/radix-tree.h> | |
5 | #include <linux/rcupdate.h> | |
6 | ||
7 | struct item { | |
3e252fa7 | 8 | struct rcu_head rcu_head; |
1366c37e | 9 | unsigned long index; |
101d9607 | 10 | unsigned int order; |
1366c37e MW |
11 | }; |
12 | ||
101d9607 MW |
13 | struct item *item_create(unsigned long index, unsigned int order); |
14 | int __item_insert(struct radix_tree_root *root, struct item *item); | |
1366c37e | 15 | int item_insert(struct radix_tree_root *root, unsigned long index); |
fd8f58c4 | 16 | void item_sanity(struct item *item, unsigned long index); |
4f3755d1 MW |
17 | int item_insert_order(struct radix_tree_root *root, unsigned long index, |
18 | unsigned order); | |
1366c37e | 19 | int item_delete(struct radix_tree_root *root, unsigned long index); |
3e252fa7 | 20 | int item_delete_rcu(struct radix_tree_root *root, unsigned long index); |
1366c37e MW |
21 | struct item *item_lookup(struct radix_tree_root *root, unsigned long index); |
22 | ||
23 | void item_check_present(struct radix_tree_root *root, unsigned long index); | |
24 | void item_check_absent(struct radix_tree_root *root, unsigned long index); | |
25 | void item_gang_check_present(struct radix_tree_root *root, | |
26 | unsigned long start, unsigned long nr, | |
27 | int chunk, int hop); | |
28 | void item_full_scan(struct radix_tree_root *root, unsigned long start, | |
29 | unsigned long nr, int chunk); | |
30 | void item_kill_tree(struct radix_tree_root *root); | |
31 | ||
268f42de MW |
32 | int tag_tagged_items(struct radix_tree_root *, pthread_mutex_t *, |
33 | unsigned long start, unsigned long end, unsigned batch, | |
34 | unsigned iftag, unsigned thentag); | |
478922e2 | 35 | |
ad3d6c72 | 36 | void xarray_tests(void); |
1366c37e | 37 | void tag_check(void); |
4f3755d1 | 38 | void multiorder_checks(void); |
3e3cdc68 | 39 | void iteration_test(unsigned order, unsigned duration); |
cfa40bcf | 40 | void benchmark(void); |
0a835c4f | 41 | void idr_checks(void); |
8ab8ba38 | 42 | void ida_tests(void); |
1366c37e MW |
43 | |
44 | struct item * | |
45 | item_tag_set(struct radix_tree_root *root, unsigned long index, int tag); | |
46 | struct item * | |
47 | item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag); | |
48 | int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag); | |
49 | void tree_verify_min_height(struct radix_tree_root *root, int maxindex); | |
50 | void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag); | |
51 | ||
52 | extern int nr_allocated; | |
53 | ||
54 | /* Normally private parts of lib/radix-tree.c */ | |
148deab2 | 55 | struct radix_tree_node *entry_to_node(void *ptr); |
0796c583 | 56 | void radix_tree_dump(struct radix_tree_root *root); |
1366c37e | 57 | int root_tag_get(struct radix_tree_root *root, unsigned int tag); |
0694f0c9 MW |
58 | unsigned long node_maxindex(struct radix_tree_node *); |
59 | unsigned long shift_maxindex(unsigned int shift); | |
6df5ee78 | 60 | int radix_tree_cpu_dead(unsigned int cpu); |
2791653a MW |
61 | struct radix_tree_preload { |
62 | unsigned nr; | |
63 | struct radix_tree_node *nodes; | |
64 | }; | |
65 | extern struct radix_tree_preload radix_tree_preloads; |