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()
212 node_copy(left, right, -nr_right); in __rebalance2()
226 shift(left, right, nr_left - target_left); in __rebalance2()
227 *key_ptr(parent, r->index) = right->keys[0]; in __rebalance2()
236 struct child left, right; in rebalance2() local
244 r = init_child(info, vt, parent, left_index + 1, &right); in rebalance2()
250 __rebalance2(info, parent, &left, &right); in rebalance2()
254 exit_child(info, &right); in rebalance2()
258 return exit_child(info, &right); in rebalance2()
268 struct btree_node *left, struct btree_node *center, struct btree_node *right, in delete_center_node() argument
281 node_shift(right, shift); in delete_center_node()
282 node_copy(center, right, shift); in delete_center_node()
283 right->header.nr_entries = cpu_to_le32(nr_right + shift); in delete_center_node()
285 *key_ptr(parent, r->index) = right->keys[0]; in delete_center_node()
299 struct btree_node *left, struct btree_node *center, struct btree_node *right, in redistribute3() argument
319 shift(left, right, s); in redistribute3()
324 shift(center, right, target_right - nr_right); in redistribute3()
330 shift(center, right, nr_center); in redistribute3()
332 shift(left, right, s); in redistribute3()
335 shift(center, right, s); in redistribute3()
341 *key_ptr(parent, r->index) = right->keys[0]; in redistribute3()
349 struct btree_node *right = r->n; in __rebalance3() local
353 uint32_t nr_right = le32_to_cpu(right->header.nr_entries); in __rebalance3()
358 BUG_ON(center->header.max_entries != right->header.max_entries); in __rebalance3()
361 delete_center_node(info, parent, l, c, r, left, center, right, in __rebalance3()
364 redistribute3(info, parent, l, c, r, left, center, right, in __rebalance3()
373 struct child left, center, right; in rebalance3() local
388 r = init_child(info, vt, parent, left_index + 2, &right); in rebalance3()
395 __rebalance3(info, parent, &left, &center, &right); in rebalance3()
400 exit_child(info, &right); in rebalance3()
406 exit_child(info, &right); in rebalance3()
410 r = exit_child(info, &right); in rebalance3()