forked from KolibriOS/kolibrios
ddk: update to 3.12-rc6
git-svn-id: svn://kolibrios.org@4103 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -68,6 +68,10 @@ extern struct rb_node *rb_prev(const struct rb_node *);
|
||||
extern struct rb_node *rb_first(const struct rb_root *);
|
||||
extern struct rb_node *rb_last(const struct rb_root *);
|
||||
|
||||
/* Postorder iteration - always visit the parent after its children */
|
||||
extern struct rb_node *rb_first_postorder(const struct rb_root *);
|
||||
extern struct rb_node *rb_next_postorder(const struct rb_node *);
|
||||
|
||||
/* Fast replacement of a single node without remove/rebalance/add/rebalance */
|
||||
extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
|
||||
struct rb_root *root);
|
||||
@@ -81,4 +85,22 @@ static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
|
||||
*rb_link = node;
|
||||
}
|
||||
|
||||
/**
|
||||
* rbtree_postorder_for_each_entry_safe - iterate over rb_root in post order of
|
||||
* given type safe against removal of rb_node entry
|
||||
*
|
||||
* @pos: the 'type *' to use as a loop cursor.
|
||||
* @n: another 'type *' to use as temporary storage
|
||||
* @root: 'rb_root *' of the rbtree.
|
||||
* @field: the name of the rb_node field within 'type'.
|
||||
*/
|
||||
#define rbtree_postorder_for_each_entry_safe(pos, n, root, field) \
|
||||
for (pos = rb_entry(rb_first_postorder(root), typeof(*pos), field),\
|
||||
n = rb_entry(rb_next_postorder(&pos->field), \
|
||||
typeof(*pos), field); \
|
||||
&pos->field; \
|
||||
pos = n, \
|
||||
n = rb_entry(rb_next_postorder(&pos->field), \
|
||||
typeof(*pos), field))
|
||||
|
||||
#endif /* _LINUX_RBTREE_H */
|
||||
|
Reference in New Issue
Block a user