MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / rb_next

Function rb_next

Ext4Fsd/rbtree.c:320–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318EXPORT_SYMBOL(rb_last);
319
320struct 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}
344EXPORT_SYMBOL(rb_next);
345
346struct rb_node *rb_prev(struct rb_node *node)

Callers 4

Ext2FlushVcbFunction · 0.85
ext3_dx_readdirFunction · 0.85
ext4_xattr_remove_itemFunction · 0.85
ext4_xattr_purge_itemsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected