[PATCH 08/13] rbtree: optimize tree rotations in rb_insert_color()

2012-07-09 Thread Michel Lespinasse
In rb_insert_color(), we can do better than calling __rb_rotate_left() and __rb_rotate_right() to handle tree rotations: we already have pointers to all relevant nodes, and know their colors (either because we want to adjust it, or because we've tested it, or we can deduce it as black due to the

[PATCH 08/13] rbtree: optimize tree rotations in rb_insert_color()

2012-07-09 Thread Michel Lespinasse
In rb_insert_color(), we can do better than calling __rb_rotate_left() and __rb_rotate_right() to handle tree rotations: we already have pointers to all relevant nodes, and know their colors (either because we want to adjust it, or because we've tested it, or we can deduce it as black due to the