lib/prio_tree.c not having dependency on fio.h enables it to be
a stand-alone library, which is useful for debugging purpose.
In fact, most of the files under lib/ directory do things this way.
--
# cat ./test2.c
#include <stdio.h>
#include "lib/prio_tree.h"
int main(void) {
struct prio_tree_root tree;
struct prio_tree_node node;
INIT_PRIO_TREE_ROOT(&tree);
INIT_PRIO_TREE_NODE(&node);
prio_tree_insert(&tree, &node);
prio_tree_remove(&tree, &node);
printf("%d\n", prio_tree_empty(&tree));
return 0;
}
# gcc -Wall -g -DBITS_PER_LONG=64 ./test2.c ./lib/prio_tree.c
# ./a.out
1
Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
#include <stdlib.h>
#include <limits.h>
#include <stdlib.h>
#include <limits.h>
+
+#include "../compiler/compiler.h"
+#define ARRAY_SIZE(x) (sizeof((x)) / (sizeof((x)[0])))
+
/*
* A clever mix of heap and radix trees forms a radix priority search tree (PST)
* which is useful for storing intervals, e.g, we can consider a vma as a closed
/*
* A clever mix of heap and radix trees forms a radix priority search tree (PST)
* which is useful for storing intervals, e.g, we can consider a vma as a closed