Lines Matching refs:right
553 static void redistribute2(struct btree_node *left, struct btree_node *right) in redistribute2() argument
556 unsigned int nr_right = le32_to_cpu(right->header.nr_entries); in redistribute2()
564 copy_entries(left, nr_left, right, 0, delta); in redistribute2()
565 shift_down(right, delta); in redistribute2()
570 shift_up(right, delta); in redistribute2()
571 copy_entries(right, 0, left, target_left, delta); in redistribute2()
575 right->header.nr_entries = cpu_to_le32(target_right); in redistribute2()
583 struct btree_node *right) in redistribute3() argument
587 unsigned int nr_right = le32_to_cpu(right->header.nr_entries); in redistribute3()
600 copy_entries(left, nr_left, right, 0, left_short); in redistribute3()
601 copy_entries(center, 0, right, left_short, target_center); in redistribute3()
602 shift_down(right, nr_right - target_right); in redistribute3()
608 copy_entries(center, left_to_center, right, 0, target_center - left_to_center); in redistribute3()
609 shift_down(right, nr_right - target_right); in redistribute3()
614 shift_up(right, right_short); in redistribute3()
615 copy_entries(right, 0, left, nr_left - right_short, right_short); in redistribute3()
621 right->header.nr_entries = cpu_to_le32(target_right); in redistribute3()
658 struct dm_block *left, *right, *parent; in split_one_into_two() local
664 r = new_block(s->info, &right); in split_one_into_two()
669 rn = dm_block_data(right); in split_one_into_two()
681 location = cpu_to_le64(dm_block_location(right)); in split_one_into_two()
686 unlock_block(s->info, right); in split_one_into_two()
692 unlock_block(s->info, right); in split_one_into_two()
696 s->nodes[1] = right; in split_one_into_two()
742 struct dm_block *left, *middle, *right, *parent; in split_two_into_three() local
752 r = shadow_child(s->info, vt, pn, parent_index + 1, &right); in split_two_into_three()
757 right = shadow_current(s); in split_two_into_three()
769 rn = dm_block_data(right); in split_two_into_three()
790 if (shadow_current(s) != right) in split_two_into_three()
791 unlock_block(s->info, right); in split_two_into_three()
800 unlock_block(s->info, right); in split_two_into_three()
804 unlock_block(s->info, right); in split_two_into_three()
809 s->nodes[1] = right; in split_two_into_three()
843 struct dm_block *left, *right, *new_parent; in btree_split_beneath() local
869 r = new_block(s->info, &right); in btree_split_beneath()
875 rn = dm_block_data(right); in btree_split_beneath()
900 val = cpu_to_le64(dm_block_location(right)); in btree_split_beneath()
906 unlock_block(s->info, right); in btree_split_beneath()
920 struct btree_node *left, *right, *parent = dm_block_data(shadow_parent(s)); in rebalance_left() local
927 right = dm_block_data(shadow_current(s)); in rebalance_left()
928 redistribute2(left, right); in rebalance_left()
929 *key_ptr(parent, parent_index) = right->keys[0]; in rebalance_left()
931 if (key < le64_to_cpu(right->keys[0])) { in rebalance_left()
949 struct btree_node *left, *right, *parent = dm_block_data(shadow_parent(s)); in rebalance_right() local
956 right = dm_block_data(sib); in rebalance_right()
957 redistribute2(left, right); in rebalance_right()
958 *key_ptr(parent, parent_index + 1) = right->keys[0]; in rebalance_right()
960 if (key < le64_to_cpu(right->keys[0])) { in rebalance_right()