xref: /openbmc/linux/tools/testing/radix-tree/test.h (revision 4f3755d1)
11366c37eSMatthew Wilcox #include <linux/gfp.h>
21366c37eSMatthew Wilcox #include <linux/types.h>
31366c37eSMatthew Wilcox #include <linux/radix-tree.h>
41366c37eSMatthew Wilcox #include <linux/rcupdate.h>
51366c37eSMatthew Wilcox 
61366c37eSMatthew Wilcox struct item {
71366c37eSMatthew Wilcox 	unsigned long index;
81366c37eSMatthew Wilcox };
91366c37eSMatthew Wilcox 
101366c37eSMatthew Wilcox struct item *item_create(unsigned long index);
114f3755d1SMatthew Wilcox int __item_insert(struct radix_tree_root *root, struct item *item,
124f3755d1SMatthew Wilcox 			unsigned order);
131366c37eSMatthew Wilcox int item_insert(struct radix_tree_root *root, unsigned long index);
144f3755d1SMatthew Wilcox int item_insert_order(struct radix_tree_root *root, unsigned long index,
154f3755d1SMatthew Wilcox 			unsigned order);
161366c37eSMatthew Wilcox int item_delete(struct radix_tree_root *root, unsigned long index);
171366c37eSMatthew Wilcox struct item *item_lookup(struct radix_tree_root *root, unsigned long index);
181366c37eSMatthew Wilcox 
191366c37eSMatthew Wilcox void item_check_present(struct radix_tree_root *root, unsigned long index);
201366c37eSMatthew Wilcox void item_check_absent(struct radix_tree_root *root, unsigned long index);
211366c37eSMatthew Wilcox void item_gang_check_present(struct radix_tree_root *root,
221366c37eSMatthew Wilcox 			unsigned long start, unsigned long nr,
231366c37eSMatthew Wilcox 			int chunk, int hop);
241366c37eSMatthew Wilcox void item_full_scan(struct radix_tree_root *root, unsigned long start,
251366c37eSMatthew Wilcox 			unsigned long nr, int chunk);
261366c37eSMatthew Wilcox void item_kill_tree(struct radix_tree_root *root);
271366c37eSMatthew Wilcox 
281366c37eSMatthew Wilcox void tag_check(void);
294f3755d1SMatthew Wilcox void multiorder_checks(void);
301366c37eSMatthew Wilcox 
311366c37eSMatthew Wilcox struct item *
321366c37eSMatthew Wilcox item_tag_set(struct radix_tree_root *root, unsigned long index, int tag);
331366c37eSMatthew Wilcox struct item *
341366c37eSMatthew Wilcox item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag);
351366c37eSMatthew Wilcox int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag);
361366c37eSMatthew Wilcox void tree_verify_min_height(struct radix_tree_root *root, int maxindex);
371366c37eSMatthew Wilcox void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag);
381366c37eSMatthew Wilcox 
391366c37eSMatthew Wilcox extern int nr_allocated;
401366c37eSMatthew Wilcox 
411366c37eSMatthew Wilcox /* Normally private parts of lib/radix-tree.c */
421366c37eSMatthew Wilcox void *indirect_to_ptr(void *ptr);
431366c37eSMatthew Wilcox int root_tag_get(struct radix_tree_root *root, unsigned int tag);
441366c37eSMatthew Wilcox unsigned long radix_tree_maxindex(unsigned int height);
45