child = _mte_get_rcu_slot(parent, slot, type, mas->tree);
if (!mt_is_empty(child)) {
- printk("set parent of child %p slot %u\n", child, slot);
- printk("parent is %p\n", parent);
+ printk("set %p[%u] to parent of %p\n", parent, slot, child);
mte_set_parent(child, parent, slot);
- printk("%p parent is %p\n", child, mte_parent(child));
}
}
}
static inline int mab_calc_split(struct maple_big_node *b_node, int size,
unsigned char slot_cnt, unsigned long min)
{
- int split = (size + 1) / 2; // Assume equal split.
+ int split = size / 2; // Assume equal split.
if (size > 2* slot_cnt) {
- split = (size + 2) / 3;
+ split = (size + 1) / 3;
}
printk("Guessing leaf split of %u (size is %d)\n", split, size);
mab_mas_cp(&b_node, split + 1, b_end + 1, &r_mas, 0);
r_mas.max = b_node.pivot[b_end];
printk("r_mas.max is %lu\n", r_mas.max);
+ } else {
+ r_mas.max = l_mas.max;
}
if (mte_is_leaf(l)) {