Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 1 | #include <linux/gfp.h> |
| 2 | #include <linux/types.h> |
| 3 | #include <linux/radix-tree.h> |
| 4 | #include <linux/rcupdate.h> |
| 5 | |
| 6 | struct item { |
| 7 | unsigned long index; |
| 8 | }; |
| 9 | |
| 10 | struct item *item_create(unsigned long index); |
Matthew Wilcox | 4f3755d | 2016-05-20 17:02:14 -0700 | [diff] [blame] | 11 | int __item_insert(struct radix_tree_root *root, struct item *item, |
| 12 | unsigned order); |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 13 | int item_insert(struct radix_tree_root *root, unsigned long index); |
Matthew Wilcox | 4f3755d | 2016-05-20 17:02:14 -0700 | [diff] [blame] | 14 | int item_insert_order(struct radix_tree_root *root, unsigned long index, |
| 15 | unsigned order); |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 16 | int item_delete(struct radix_tree_root *root, unsigned long index); |
| 17 | struct item *item_lookup(struct radix_tree_root *root, unsigned long index); |
| 18 | |
| 19 | void item_check_present(struct radix_tree_root *root, unsigned long index); |
| 20 | void item_check_absent(struct radix_tree_root *root, unsigned long index); |
| 21 | void item_gang_check_present(struct radix_tree_root *root, |
| 22 | unsigned long start, unsigned long nr, |
| 23 | int chunk, int hop); |
| 24 | void item_full_scan(struct radix_tree_root *root, unsigned long start, |
| 25 | unsigned long nr, int chunk); |
| 26 | void item_kill_tree(struct radix_tree_root *root); |
| 27 | |
| 28 | void tag_check(void); |
Matthew Wilcox | 4f3755d | 2016-05-20 17:02:14 -0700 | [diff] [blame] | 29 | void multiorder_checks(void); |
Ross Zwisler | eec4852 | 2016-10-11 13:51:21 -0700 | [diff] [blame] | 30 | void iteration_test(void); |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 31 | |
| 32 | struct item * |
| 33 | item_tag_set(struct radix_tree_root *root, unsigned long index, int tag); |
| 34 | struct item * |
| 35 | item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag); |
| 36 | int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag); |
| 37 | void tree_verify_min_height(struct radix_tree_root *root, int maxindex); |
| 38 | void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag); |
| 39 | |
| 40 | extern int nr_allocated; |
| 41 | |
| 42 | /* Normally private parts of lib/radix-tree.c */ |
Ross Zwisler | 0796c58 | 2016-05-20 17:02:55 -0700 | [diff] [blame] | 43 | void radix_tree_dump(struct radix_tree_root *root); |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 44 | int root_tag_get(struct radix_tree_root *root, unsigned int tag); |
Matthew Wilcox | 0694f0c | 2016-05-20 17:03:16 -0700 | [diff] [blame] | 45 | unsigned long node_maxindex(struct radix_tree_node *); |
| 46 | unsigned long shift_maxindex(unsigned int shift); |