Lines Matching defs:brother
617 * brother.
627 * Have our son/standin adopt his brother as his new son.
823 struct rb_node *brother = parent->rb_nodes[other];
827 KASSERT(!RB_SENTINEL_P(brother));
829 * For cases 1, 2a, and 2b, our brother's children must
833 && RB_BLACK_P(brother->rb_left)
834 && RB_BLACK_P(brother->rb_right)) {
835 if (RB_RED_P(brother)) {
837 * Case 1: Our brother is red, swap its
849 brother = parent->rb_nodes[other];
850 KASSERT(!RB_SENTINEL_P(brother));
852 KASSERT(RB_BLACK_P(brother));
853 KASSERT(rb_tree_check_node(rbt, brother, NULL, false));
857 * Both our parent and brother are black.
858 * Change our brother to red, advance up rank
865 RB_MARK_RED(brother);
866 KASSERT(RB_BLACK_P(brother->rb_left));
867 KASSERT(RB_BLACK_P(brother->rb_right));
870 KASSERT(rb_tree_check_node(rbt, brother, NULL, false));
882 && RB_BLACK_P(brother)
883 && RB_BLACK_P(brother->rb_left)
884 && RB_BLACK_P(brother->rb_right)) {
886 KASSERT(RB_BLACK_P(brother));
887 KASSERT(RB_BLACK_P(brother->rb_left));
888 KASSERT(RB_BLACK_P(brother->rb_right));
890 * We are black, our father is red, our brother and
892 * colors of our father and brother (to black and red
900 RB_MARK_RED(brother);
901 KASSERT(rb_tree_check_node(rbt, brother, NULL, true));
905 * Our brother must be black and have at least one
908 KASSERT(RB_BLACK_P(brother));
909 KASSERT(RB_RED_P(brother->rb_nodes[which]) ||
910 RB_RED_P(brother->rb_nodes[other]));
911 if (RB_BLACK_P(brother->rb_nodes[other])) {
913 * Case 3: our brother is black, our near
915 * Swap our brother with our near nephew.
923 KASSERT(RB_RED_P(brother->rb_nodes[which]));
924 rb_tree_reparent_nodes(rbt, brother, which);
925 KASSERT(RB_FATHER(brother) == parent->rb_nodes[other]);
926 brother = parent->rb_nodes[other];
927 KASSERT(RB_RED_P(brother->rb_nodes[other]));
930 * Case 4: our brother is black and our far nephew
931 * is red. Swap our father and brother locations and
953 KASSERT(RB_BLACK_P(brother));
954 KASSERT(RB_RED_P(brother->rb_nodes[other]));
955 RB_MARK_BLACK(brother->rb_nodes[other]);
1132 const struct rb_node *brother;
1134 brother = RB_FATHER(self)->rb_nodes[RB_POSITION(self) ^ RB_DIR_OTHER];
1138 * have no brother or my brother also be red and
1142 || RB_SENTINEL_P(brother)
1143 || RB_RED_P(brother)
1144 || RB_CHILDLESS_P(brother));
1155 * then my brother must either be black or have two
1159 || RB_BLACK_P(brother)
1160 || (RB_TWOCHILDREN_P(brother)
1161 && RB_BLACK_P(brother->rb_left)
1162 && RB_BLACK_P(brother->rb_right)));