Lines Matching refs:right
82 static void node_copy(struct btree_node *left, struct btree_node *right, int shift) in node_copy() argument
86 BUG_ON(value_size != le32_to_cpu(right->header.value_size)); in node_copy()
92 key_ptr(right, 0), in node_copy()
95 value_ptr(right, 0), in node_copy()
98 BUG_ON(shift > le32_to_cpu(right->header.max_entries)); in node_copy()
99 memcpy(key_ptr(right, 0), in node_copy()
102 memcpy(value_ptr(right, 0), in node_copy()
173 static void shift(struct btree_node *left, struct btree_node *right, int count) in shift() argument
176 uint32_t nr_right = le32_to_cpu(right->header.nr_entries); in shift()
178 uint32_t r_max_entries = le32_to_cpu(right->header.max_entries); in shift()
188 node_shift(right, count); in shift()
189 node_copy(left, right, count); in shift()
191 node_copy(left, right, count); in shift()
192 node_shift(right, count); in shift()
196 right->header.nr_entries = cpu_to_le32(nr_right + count); in shift()
203 struct btree_node *right = r->n; in __rebalance2() local
205 uint32_t nr_right = le32_to_cpu(right->header.nr_entries); in __rebalance2()
218 node_copy(left, right, -nr_right); in __rebalance2()
232 shift(left, right, nr_left - target_left); in __rebalance2()
233 *key_ptr(parent, r->index) = right->keys[0]; in __rebalance2()
242 struct child left, right; in rebalance2() local
250 r = init_child(info, vt, parent, left_index + 1, &right); in rebalance2()
256 __rebalance2(info, parent, &left, &right); in rebalance2()
259 exit_child(info, &right); in rebalance2()
271 struct btree_node *left, struct btree_node *center, struct btree_node *right, in delete_center_node() argument
284 node_shift(right, shift); in delete_center_node()
285 node_copy(center, right, shift); in delete_center_node()
286 right->header.nr_entries = cpu_to_le32(nr_right + shift); in delete_center_node()
288 *key_ptr(parent, r->index) = right->keys[0]; in delete_center_node()
302 struct btree_node *left, struct btree_node *center, struct btree_node *right, in redistribute3() argument
322 shift(left, right, s); in redistribute3()
327 shift(center, right, target_right - nr_right); in redistribute3()
333 shift(center, right, nr_center); in redistribute3()
335 shift(left, right, s); in redistribute3()
338 shift(center, right, s); in redistribute3()
344 *key_ptr(parent, r->index) = right->keys[0]; in redistribute3()
352 struct btree_node *right = r->n; in __rebalance3() local
356 uint32_t nr_right = le32_to_cpu(right->header.nr_entries); in __rebalance3()
361 BUG_ON(center->header.max_entries != right->header.max_entries); in __rebalance3()
364 delete_center_node(info, parent, l, c, r, left, center, right, in __rebalance3()
367 redistribute3(info, parent, l, c, r, left, center, right, in __rebalance3()
376 struct child left, center, right; in rebalance3() local
391 r = init_child(info, vt, parent, left_index + 2, &right); in rebalance3()
398 __rebalance3(info, parent, &left, ¢er, &right); in rebalance3()
402 exit_child(info, &right); in rebalance3()