test.h 1.8 KB
Newer Older
M
Matthew Wilcox 已提交
1 2 3 4 5 6 7
#include <linux/gfp.h>
#include <linux/types.h>
#include <linux/radix-tree.h>
#include <linux/rcupdate.h>

struct item {
	unsigned long index;
8
	unsigned int order;
M
Matthew Wilcox 已提交
9 10
};

11 12
struct item *item_create(unsigned long index, unsigned int order);
int __item_insert(struct radix_tree_root *root, struct item *item);
M
Matthew Wilcox 已提交
13
int item_insert(struct radix_tree_root *root, unsigned long index);
14 15
int item_insert_order(struct radix_tree_root *root, unsigned long index,
			unsigned order);
M
Matthew Wilcox 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28
int item_delete(struct radix_tree_root *root, unsigned long index);
struct item *item_lookup(struct radix_tree_root *root, unsigned long index);

void item_check_present(struct radix_tree_root *root, unsigned long index);
void item_check_absent(struct radix_tree_root *root, unsigned long index);
void item_gang_check_present(struct radix_tree_root *root,
			unsigned long start, unsigned long nr,
			int chunk, int hop);
void item_full_scan(struct radix_tree_root *root, unsigned long start,
			unsigned long nr, int chunk);
void item_kill_tree(struct radix_tree_root *root);

void tag_check(void);
29
void multiorder_checks(void);
30
void iteration_test(void);
31
void benchmark(void);
M
Matthew Wilcox 已提交
32 33 34 35 36 37 38 39 40 41 42 43

struct item *
item_tag_set(struct radix_tree_root *root, unsigned long index, int tag);
struct item *
item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag);
int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag);
void tree_verify_min_height(struct radix_tree_root *root, int maxindex);
void verify_tag_consistency(struct radix_tree_root *root, unsigned int tag);

extern int nr_allocated;

/* Normally private parts of lib/radix-tree.c */
44
void radix_tree_dump(struct radix_tree_root *root);
M
Matthew Wilcox 已提交
45
int root_tag_get(struct radix_tree_root *root, unsigned int tag);
46 47
unsigned long node_maxindex(struct radix_tree_node *);
unsigned long shift_maxindex(unsigned int shift);
48
int radix_tree_cpu_dead(unsigned int cpu);