The patch titled rb_tree: reorganize code in rb_erase() for additional changes has been added to the -mm tree. Its filename is rb_tree-reorganize-code-in-rb_erase-for-additional-changes.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: rb_tree: reorganize code in rb_erase() for additional changes From: "Wolfram Strepp" <wstrepp@xxxxxx> First, move some code around in order to make the next change more obvious. Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> Signed-off-by: Wolfram Strepp <wstrepp@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/rbtree.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff -puN lib/rbtree.c~rb_tree-reorganize-code-in-rb_erase-for-additional-changes lib/rbtree.c --- a/lib/rbtree.c~rb_tree-reorganize-code-in-rb_erase-for-additional-changes +++ a/lib/rbtree.c @@ -231,6 +231,16 @@ void rb_erase(struct rb_node *node, stru node = node->rb_right; while ((left = node->rb_left) != NULL) node = left; + + if (rb_parent(old)) + { + if (rb_parent(old)->rb_left == old) + rb_parent(old)->rb_left = node; + else + rb_parent(old)->rb_right = node; + } else + root->rb_node = node; + child = node->rb_right; parent = rb_parent(node); color = rb_color(node); @@ -247,15 +257,6 @@ void rb_erase(struct rb_node *node, stru node->rb_right = old->rb_right; node->rb_left = old->rb_left; - if (rb_parent(old)) - { - if (rb_parent(old)->rb_left == old) - rb_parent(old)->rb_left = node; - else - rb_parent(old)->rb_right = node; - } else - root->rb_node = node; - rb_set_parent(old->rb_left, node); if (old->rb_right) rb_set_parent(old->rb_right, node); _ Patches currently in -mm which might be from wstrepp@xxxxxx are rb_tree-reorganize-code-in-rb_erase-for-additional-changes.patch rb_tree-make-clear-distinction-between-two-different-cases-in-rb_erase.patch rb_tree-remove-redundant-if-condition-in-rb_erase.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html