diff options
| author | Andrew Morton <akpm@digeo.com> | 2002-10-07 21:28:11 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-07 21:28:11 -0700 |
| commit | da5223ff390a6dc975989debf7905640fbb979b7 (patch) | |
| tree | a38c73ce5ccaa2bdd688bb9689c69f5bc196d239 /lib | |
| parent | 1b5dd0c2d0bd49b66c99cadac69ed50fbf85492e (diff) | |
[PATCH] ext3 indexed directory support
Daniel Phillips' indexed directory support. Ported from ext2 by
Christopher Li. Contributions from Andreas Dilger, Stephen Tweedie,
lots from Ted.
It requires e2fsprogs-1.29; I've updated the Changes file to reflect
that.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/rbtree.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/rbtree.c b/lib/rbtree.c index 91590e07ebbe..860115d49dd3 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c @@ -296,6 +296,22 @@ void rb_erase(struct rb_node *node, struct rb_root *root) } EXPORT_SYMBOL(rb_erase); +/* + * This function returns the first node (in sort order) of the tree. + */ +struct rb_node *rb_first(struct rb_root *root) +{ + struct rb_node *n; + + n = root->rb_node; + if (!n) + return 0; + while (n->rb_left) + n = n->rb_left; + return n; +} +EXPORT_SYMBOL(rb_first); + struct rb_node *rb_next(struct rb_node *node) { /* If we have a right-hand child, go down and then left as far |
