| 318 | EXPORT_SYMBOL(rb_last); |
| 319 | |
| 320 | struct rb_node *rb_next(struct rb_node *node) |
| 321 | { |
| 322 | struct rb_node *parent; |
| 323 | |
| 324 | /* If we have a right-hand child, go down and then left as far |
| 325 | as we can. */ |
| 326 | if (node->rb_right) { |
| 327 | node = node->rb_right; |
| 328 | while (node->rb_left) |
| 329 | node=node->rb_left; |
| 330 | return node; |
| 331 | } |
| 332 | |
| 333 | /* No right-hand children. Everything down and left is |
| 334 | smaller than us, so any 'next' node must be in the general |
| 335 | direction of our parent. Go up the tree; any time the |
| 336 | ancestor is a right-hand child of its parent, keep going |
| 337 | up. First time it's a left-hand child of its parent, said |
| 338 | parent is our 'next' node. */ |
| 339 | while ((parent = rb_parent(node)) && node == parent->rb_right) |
| 340 | node = parent; |
| 341 | |
| 342 | return parent; |
| 343 | } |
| 344 | EXPORT_SYMBOL(rb_next); |
| 345 | |
| 346 | struct rb_node *rb_prev(struct rb_node *node) |
no outgoing calls
no test coverage detected