Lines Matching refs:right

29  * Each node may have a left or right sibling.  When decending the spine,
37 * ==> rebalance(node, right sibling)
39 * [C] No right sibling
42 * [D] Both siblings, total_entries(left, node, right) <= DEL_THRESHOLD
43 * ==> delete node adding it's contents to left and right
45 * [E] Both siblings, total_entries(left, node, right) > DEL_THRESHOLD
46 * ==> rebalance(left, node, right)
86 static int node_copy(struct btree_node *left, struct btree_node *right, int shift)
91 if (value_size != le32_to_cpu(right->header.value_size)) {
105 key_ptr(right, 0),
108 value_ptr(right, 0),
111 if (shift > le32_to_cpu(right->header.max_entries)) {
116 memcpy(key_ptr(right, 0),
119 memcpy(value_ptr(right, 0),
192 static int shift(struct btree_node *left, struct btree_node *right, int count)
196 uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
198 uint32_t r_max_entries = le32_to_cpu(right->header.max_entries);
219 node_shift(right, count);
220 r = node_copy(left, right, count);
224 r = node_copy(left, right, count);
227 node_shift(right, count);
231 right->header.nr_entries = cpu_to_le32(nr_right + count);
241 struct btree_node *right = r->n;
243 uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
256 node_copy(left, right, -nr_right);
261 * We need to decrement the right block, but not it's
271 ret = shift(left, right, nr_left - target_left);
274 *key_ptr(parent, r->index) = right->keys[0];
284 struct child left, right;
292 r = init_child(info, vt, parent, left_index + 1, &right);
298 r = __rebalance2(info, parent, &left, &right);
301 exit_child(info, &right);
308 * in right, then rebalance2. This wastes some cpu, but I want something
313 struct btree_node *left, struct btree_node *center, struct btree_node *right,
335 node_shift(right, shift);
336 node_copy(center, right, shift);
337 right->header.nr_entries = cpu_to_le32(nr_right + shift);
339 *key_ptr(parent, r->index) = right->keys[0];
353 struct btree_node *left, struct btree_node *center, struct btree_node *right,
376 ret = shift(left, right, s);
387 ret = shift(center, right, target_right - nr_right);
394 ret = shift(center, right, nr_center);
398 ret = shift(left, right, s);
403 ret = shift(center, right, s);
414 *key_ptr(parent, r->index) = right->keys[0];
423 struct btree_node *right = r->n;
427 uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
432 (center->header.max_entries != right->header.max_entries)) {
438 return delete_center_node(info, parent, l, c, r, left, center, right,
442 return redistribute3(info, parent, l, c, r, left, center, right,
451 struct child left, center, right;
466 r = init_child(info, vt, parent, left_index + 2, &right);
473 r = __rebalance3(info, parent, &left, &center, &right);
477 exit_child(info, &right);