From: Michel Lespinasse Date: Mon, 8 Oct 2012 23:31:11 +0000 (-0700) Subject: rbtree: handle 1-child recoloring in rb_erase() instead of rb_erase_color() X-Git-Tag: v3.7-rc1~74^2~87 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46b6135a7402ac23c5b25f2bd79b03bab8f98278;p=pandora-kernel.git rbtree: handle 1-child recoloring in rb_erase() instead of rb_erase_color() An interesting observation for rb_erase() is that when a node has exactly one child, the node must be black and the child must be red. An interesting consequence is that removing such a node can be done by simply replacing it with its child and making the child black, which we can do efficiently in rb_erase(). __rb_erase_color() then only needs to handle the no-childs case and can be modified accordingly. Signed-off-by: Michel Lespinasse Acked-by: Rik van Riel Cc: Peter Zijlstra Cc: Andrea Arcangeli Cc: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed