diff options
Diffstat (limited to 'include/linux/rbtree_augmented.h')
-rw-r--r-- | include/linux/rbtree_augmented.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h index 2ac60c9cf644..fea49b5da12a 100644 --- a/include/linux/rbtree_augmented.h +++ b/include/linux/rbtree_augmented.h | |||
@@ -123,9 +123,9 @@ __rb_change_child(struct rb_node *old, struct rb_node *new, | |||
123 | extern void __rb_erase_color(struct rb_node *parent, struct rb_root *root, | 123 | extern void __rb_erase_color(struct rb_node *parent, struct rb_root *root, |
124 | void (*augment_rotate)(struct rb_node *old, struct rb_node *new)); | 124 | void (*augment_rotate)(struct rb_node *old, struct rb_node *new)); |
125 | 125 | ||
126 | static __always_inline void | 126 | static __always_inline struct rb_node * |
127 | rb_erase_augmented(struct rb_node *node, struct rb_root *root, | 127 | __rb_erase_augmented(struct rb_node *node, struct rb_root *root, |
128 | const struct rb_augment_callbacks *augment) | 128 | const struct rb_augment_callbacks *augment) |
129 | { | 129 | { |
130 | struct rb_node *child = node->rb_right, *tmp = node->rb_left; | 130 | struct rb_node *child = node->rb_right, *tmp = node->rb_left; |
131 | struct rb_node *parent, *rebalance; | 131 | struct rb_node *parent, *rebalance; |
@@ -217,6 +217,14 @@ rb_erase_augmented(struct rb_node *node, struct rb_root *root, | |||
217 | } | 217 | } |
218 | 218 | ||
219 | augment->propagate(tmp, NULL); | 219 | augment->propagate(tmp, NULL); |
220 | return rebalance; | ||
221 | } | ||
222 | |||
223 | static __always_inline void | ||
224 | rb_erase_augmented(struct rb_node *node, struct rb_root *root, | ||
225 | const struct rb_augment_callbacks *augment) | ||
226 | { | ||
227 | struct rb_node *rebalance = __rb_erase_augmented(node, root, augment); | ||
220 | if (rebalance) | 228 | if (rebalance) |
221 | __rb_erase_color(rebalance, root, augment->rotate); | 229 | __rb_erase_color(rebalance, root, augment->rotate); |
222 | } | 230 | } |