License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6-block.git] / tools / testing / radix-tree / test.h
CommitLineData
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
7struct item {
8 unsigned long index;
101d9607 9 unsigned int order;
1366c37e
MW
10};
11
101d9607
MW
12struct item *item_create(unsigned long index, unsigned int order);
13int __item_insert(struct radix_tree_root *root, struct item *item);
1366c37e 14int item_insert(struct radix_tree_root *root, unsigned long index);
4f3755d1
MW
15int item_insert_order(struct radix_tree_root *root, unsigned long index,
16 unsigned order);
1366c37e
MW
17int item_delete(struct radix_tree_root *root, unsigned long index);
18struct item *item_lookup(struct radix_tree_root *root, unsigned long index);
19
20void item_check_present(struct radix_tree_root *root, unsigned long index);
21void item_check_absent(struct radix_tree_root *root, unsigned long index);
22void item_gang_check_present(struct radix_tree_root *root,
23 unsigned long start, unsigned long nr,
24 int chunk, int hop);
25void item_full_scan(struct radix_tree_root *root, unsigned long start,
26 unsigned long nr, int chunk);
27void item_kill_tree(struct radix_tree_root *root);
28
268f42de
MW
29int tag_tagged_items(struct radix_tree_root *, pthread_mutex_t *,
30 unsigned long start, unsigned long end, unsigned batch,
31 unsigned iftag, unsigned thentag);
478922e2
MW
32unsigned long find_item(struct radix_tree_root *, void *item);
33
1366c37e 34void tag_check(void);
4f3755d1 35void multiorder_checks(void);
3e3cdc68 36void iteration_test(unsigned order, unsigned duration);
cfa40bcf 37void benchmark(void);
0a835c4f
MW
38void idr_checks(void);
39void ida_checks(void);
4ecd9542 40void ida_thread_tests(void);
1366c37e
MW
41
42struct item *
43item_tag_set(struct radix_tree_root *root, unsigned long index, int tag);
44struct item *
45item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag);
46int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag);
47void tree_verify_min_height(struct radix_tree_root *root, int maxindex);
48void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag);
49
50extern int nr_allocated;
51
52/* Normally private parts of lib/radix-tree.c */
148deab2 53struct radix_tree_node *entry_to_node(void *ptr);
0796c583 54void radix_tree_dump(struct radix_tree_root *root);
1366c37e 55int root_tag_get(struct radix_tree_root *root, unsigned int tag);
0694f0c9
MW
56unsigned long node_maxindex(struct radix_tree_node *);
57unsigned long shift_maxindex(unsigned int shift);
6df5ee78 58int radix_tree_cpu_dead(unsigned int cpu);
2791653a
MW
59struct radix_tree_preload {
60 unsigned nr;
61 struct radix_tree_node *nodes;
62};
63extern struct radix_tree_preload radix_tree_preloads;