X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Frbtree.c;h=14b791ac5089727c8430590e63d511201492bb56;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=621552c344e77ae036133a1b8c9f9455ca8c8b78;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/lib/rbtree.c b/lib/rbtree.c index 621552c34..14b791ac5 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -312,6 +312,19 @@ struct rb_node *rb_first(struct rb_root *root) } EXPORT_SYMBOL(rb_first); +struct rb_node *rb_last(struct rb_root *root) +{ + struct rb_node *n; + + n = root->rb_node; + if (!n) + return NULL; + while (n->rb_right) + n = n->rb_right; + return n; +} +EXPORT_SYMBOL(rb_last); + struct rb_node *rb_next(struct rb_node *node) { /* If we have a right-hand child, go down and then left as far