2016-03-17 21:21:45 +00:00
|
|
|
#include <linux/gfp.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/radix-tree.h>
|
|
|
|
#include <linux/rcupdate.h>
|
|
|
|
|
|
|
|
struct item {
|
|
|
|
unsigned long index;
|
2016-12-14 23:08:23 +00:00
|
|
|
unsigned int order;
|
2016-03-17 21:21:45 +00:00
|
|
|
};
|
|
|
|
|
2016-12-14 23:08:23 +00:00
|
|
|
struct item *item_create(unsigned long index, unsigned int order);
|
|
|
|
int __item_insert(struct radix_tree_root *root, struct item *item);
|
2016-03-17 21:21:45 +00:00
|
|
|
int item_insert(struct radix_tree_root *root, unsigned long index);
|
2016-05-21 00:02:14 +00:00
|
|
|
int item_insert_order(struct radix_tree_root *root, unsigned long index,
|
|
|
|
unsigned order);
|
2016-03-17 21:21:45 +00:00
|
|
|
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);
|
|
|
|
|
2016-12-14 23:08:55 +00:00
|
|
|
int tag_tagged_items(struct radix_tree_root *, pthread_mutex_t *,
|
|
|
|
unsigned long start, unsigned long end, unsigned batch,
|
|
|
|
unsigned iftag, unsigned thentag);
|
2016-12-14 23:08:52 +00:00
|
|
|
unsigned long find_item(struct radix_tree_root *, void *item);
|
|
|
|
|
2016-03-17 21:21:45 +00:00
|
|
|
void tag_check(void);
|
2016-05-21 00:02:14 +00:00
|
|
|
void multiorder_checks(void);
|
2016-12-14 23:09:10 +00:00
|
|
|
void iteration_test(unsigned order, unsigned duration);
|
2016-12-14 23:08:14 +00:00
|
|
|
void benchmark(void);
|
2016-12-20 15:27:56 +00:00
|
|
|
void idr_checks(void);
|
|
|
|
void ida_checks(void);
|
2017-03-03 17:16:10 +00:00
|
|
|
void ida_thread_tests(void);
|
2016-03-17 21:21:45 +00:00
|
|
|
|
|
|
|
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 */
|
2016-12-14 23:08:49 +00:00
|
|
|
struct radix_tree_node *entry_to_node(void *ptr);
|
2016-05-21 00:02:55 +00:00
|
|
|
void radix_tree_dump(struct radix_tree_root *root);
|
2016-03-17 21:21:45 +00:00
|
|
|
int root_tag_get(struct radix_tree_root *root, unsigned int tag);
|
2016-05-21 00:03:16 +00:00
|
|
|
unsigned long node_maxindex(struct radix_tree_node *);
|
|
|
|
unsigned long shift_maxindex(unsigned int shift);
|
2016-12-14 23:08:05 +00:00
|
|
|
int radix_tree_cpu_dead(unsigned int cpu);
|
2016-12-14 23:09:04 +00:00
|
|
|
struct radix_tree_preload {
|
|
|
|
unsigned nr;
|
|
|
|
struct radix_tree_node *nodes;
|
|
|
|
};
|
|
|
|
extern struct radix_tree_preload radix_tree_preloads;
|