aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rbtree.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-06-21 03:36:18 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-06-23 11:10:39 -0400
commitdd67d051529387f6e44d22d1d5540ef281965fdd (patch)
tree80457f9a2ad3e562b179e40f5c8d51b4f24d6d9e /include/linux/rbtree.h
parent9e94cd4fd1812bab45237f998b3c6fa1b24023fd (diff)
[PATCH] rbtree: support functions used by the io schedulers
They all duplicate macros to check for empty root and/or node, and clearing a node. So put those in rbtree.h. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'include/linux/rbtree.h')
-rw-r--r--include/linux/rbtree.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index f37006f21664..8d5382e62c08 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -132,6 +132,10 @@ static inline void rb_set_color(struct rb_node *rb, int color)
132#define RB_ROOT (struct rb_root) { NULL, } 132#define RB_ROOT (struct rb_root) { NULL, }
133#define rb_entry(ptr, type, member) container_of(ptr, type, member) 133#define rb_entry(ptr, type, member) container_of(ptr, type, member)
134 134
135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
136#define RB_EMPTY_NODE(node) (rb_parent(node) != node)
137#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
138
135extern void rb_insert_color(struct rb_node *, struct rb_root *); 139extern void rb_insert_color(struct rb_node *, struct rb_root *);
136extern void rb_erase(struct rb_node *, struct rb_root *); 140extern void rb_erase(struct rb_node *, struct rb_root *);
137 141