Lines Matching refs:right
25 * Each node may have a left or right sibling. When decending the spine,
33 * ==> rebalance(node, right sibling)
35 * [C] No right sibling
38 * [D] Both siblings, total_entries(left, node, right) <= DEL_THRESHOLD
39 * ==> delete node adding it's contents to left and right
41 * [E] Both siblings, total_entries(left, node, right) > DEL_THRESHOLD
42 * ==> rebalance(left, node, right)
82 static void node_copy(struct btree_node *left, struct btree_node *right, int shift)
86 BUG_ON(value_size != le32_to_cpu(right->header.value_size));
92 key_ptr(right, 0),
95 value_ptr(right, 0),
98 BUG_ON(shift > le32_to_cpu(right->header.max_entries));
99 memcpy(key_ptr(right, 0),
102 memcpy(value_ptr(right, 0),
173 static void shift(struct btree_node *left, struct btree_node *right, int count)
176 uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
178 uint32_t r_max_entries = le32_to_cpu(right->header.max_entries);
188 node_shift(right, count);
189 node_copy(left, right, count);
191 node_copy(left, right, count);
192 node_shift(right, count);
196 right->header.nr_entries = cpu_to_le32(nr_right + count);
203 struct btree_node *right = r->n;
205 uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
218 node_copy(left, right, -nr_right);
223 * We need to decrement the right block, but not it's
232 shift(left, right, nr_left - target_left);
233 *key_ptr(parent, r->index) = right->keys[0];
242 struct child left, right;
250 r = init_child(info, vt, parent, left_index + 1, &right);
256 __rebalance2(info, parent, &left, &right);
259 exit_child(info, &right);
266 * in right, then rebalance2. This wastes some cpu, but I want something
271 struct btree_node *left, struct btree_node *center, struct btree_node *right,
284 node_shift(right, shift);
285 node_copy(center, right, shift);
286 right->header.nr_entries = cpu_to_le32(nr_right + shift);
288 *key_ptr(parent, r->index) = right->keys[0];
302 struct btree_node *left, struct btree_node *center, struct btree_node *right,
322 shift(left, right, s);
327 shift(center, right, target_right - nr_right);
333 shift(center, right, nr_center);
335 shift(left, right, s);
338 shift(center, right, s);
344 *key_ptr(parent, r->index) = right->keys[0];
352 struct btree_node *right = r->n;
356 uint32_t nr_right = le32_to_cpu(right->header.nr_entries);
361 BUG_ON(center->header.max_entries != right->header.max_entries);
364 delete_center_node(info, parent, l, c, r, left, center, right,
367 redistribute3(info, parent, l, c, r, left, center, right,
376 struct child left, center, right;
391 r = init_child(info, vt, parent, left_index + 2, &right);
398 __rebalance3(info, parent, &left, ¢er, &right);
402 exit_child(info, &right);