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; |
Matthew Wilcox | 101d960 | 2016-12-14 15:08:23 -0800 | [diff] [blame] | 8 | unsigned int order; |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 9 | }; |
| 10 | |
Matthew Wilcox | 101d960 | 2016-12-14 15:08:23 -0800 | [diff] [blame] | 11 | struct item *item_create(unsigned long index, unsigned int order); |
| 12 | int __item_insert(struct radix_tree_root *root, struct item *item); |
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 | |
Matthew Wilcox | 268f42d | 2016-12-14 15:08:55 -0800 | [diff] [blame] | 28 | int tag_tagged_items(struct radix_tree_root *, pthread_mutex_t *, |
| 29 | unsigned long start, unsigned long end, unsigned batch, |
| 30 | unsigned iftag, unsigned thentag); |
Matthew Wilcox | 478922e | 2016-12-14 15:08:52 -0800 | [diff] [blame] | 31 | unsigned long find_item(struct radix_tree_root *, void *item); |
| 32 | |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 33 | void tag_check(void); |
Matthew Wilcox | 4f3755d | 2016-05-20 17:02:14 -0700 | [diff] [blame] | 34 | void multiorder_checks(void); |
Matthew Wilcox | 3e3cdc6 | 2016-12-14 15:09:10 -0800 | [diff] [blame] | 35 | void iteration_test(unsigned order, unsigned duration); |
Konstantin Khlebnikov | cfa40bc | 2016-12-14 15:08:14 -0800 | [diff] [blame] | 36 | void benchmark(void); |
Matthew Wilcox | 0a835c4 | 2016-12-20 10:27:56 -0500 | [diff] [blame] | 37 | void idr_checks(void); |
| 38 | void ida_checks(void); |
Matthew Wilcox | 4ecd954 | 2017-03-03 12:16:10 -0500 | [diff] [blame] | 39 | void ida_thread_tests(void); |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 40 | |
| 41 | struct item * |
| 42 | item_tag_set(struct radix_tree_root *root, unsigned long index, int tag); |
| 43 | struct item * |
| 44 | item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag); |
| 45 | int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag); |
| 46 | void tree_verify_min_height(struct radix_tree_root *root, int maxindex); |
| 47 | void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag); |
| 48 | |
| 49 | extern int nr_allocated; |
| 50 | |
| 51 | /* Normally private parts of lib/radix-tree.c */ |
Matthew Wilcox | 148deab | 2016-12-14 15:08:49 -0800 | [diff] [blame] | 52 | struct radix_tree_node *entry_to_node(void *ptr); |
Ross Zwisler | 0796c58 | 2016-05-20 17:02:55 -0700 | [diff] [blame] | 53 | void radix_tree_dump(struct radix_tree_root *root); |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 54 | int root_tag_get(struct radix_tree_root *root, unsigned int tag); |
Matthew Wilcox | 0694f0c | 2016-05-20 17:03:16 -0700 | [diff] [blame] | 55 | unsigned long node_maxindex(struct radix_tree_node *); |
| 56 | unsigned long shift_maxindex(unsigned int shift); |
Matthew Wilcox | 6df5ee7 | 2016-12-14 15:08:05 -0800 | [diff] [blame] | 57 | int radix_tree_cpu_dead(unsigned int cpu); |
Matthew Wilcox | 2791653 | 2016-12-14 15:09:04 -0800 | [diff] [blame] | 58 | struct radix_tree_preload { |
| 59 | unsigned nr; |
| 60 | struct radix_tree_node *nodes; |
| 61 | }; |
| 62 | extern struct radix_tree_preload radix_tree_preloads; |