blob: 217fb2403f0901c13d55936fa7cfe0c6c9da4157 [file] [log] [blame]
Matthew Wilcox1366c372016-03-17 14:21:45 -07001#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;
8};
9
10struct item *item_create(unsigned long index);
Matthew Wilcox4f3755d2016-05-20 17:02:14 -070011int __item_insert(struct radix_tree_root *root, struct item *item,
12 unsigned order);
Matthew Wilcox1366c372016-03-17 14:21:45 -070013int item_insert(struct radix_tree_root *root, unsigned long index);
Matthew Wilcox4f3755d2016-05-20 17:02:14 -070014int item_insert_order(struct radix_tree_root *root, unsigned long index,
15 unsigned order);
Matthew Wilcox1366c372016-03-17 14:21:45 -070016int 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
28void tag_check(void);
Matthew Wilcox4f3755d2016-05-20 17:02:14 -070029void multiorder_checks(void);
Ross Zwislereec48522016-10-11 13:51:21 -070030void iteration_test(void);
Matthew Wilcox1366c372016-03-17 14:21:45 -070031
32struct item *
33item_tag_set(struct radix_tree_root *root, unsigned long index, int tag);
34struct item *
35item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag);
36int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag);
37void tree_verify_min_height(struct radix_tree_root *root, int maxindex);
38void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag);
39
40extern int nr_allocated;
41
42/* Normally private parts of lib/radix-tree.c */
Ross Zwisler0796c582016-05-20 17:02:55 -070043void radix_tree_dump(struct radix_tree_root *root);
Matthew Wilcox1366c372016-03-17 14:21:45 -070044int root_tag_get(struct radix_tree_root *root, unsigned int tag);
Matthew Wilcox0694f0c2016-05-20 17:03:16 -070045unsigned long node_maxindex(struct radix_tree_node *);
46unsigned long shift_maxindex(unsigned int shift);