struct maple_big_node *bn,
unsigned char end)
{
- int i;
- unsigned long max = mas->max;
+ unsigned long max;
if (mt_in_rcu(mas->tree))
return false; // Need to be rcu safe.
+ max = mas->max;
mab_mas_cp(bn, 0, bn->b_end, mas);
mas->max = max;
// Zero end of node.
if (end > bn->b_end) {
- for (i = bn->b_end + 1; i < mt_pivots[bn->type]; i++) {
- mte_set_slot(mas->node, i, NULL);
- mte_set_pivot(mas->node, i, 0);
-
- // if (!mte_is_leaf(mas->node) && mt_is_alloc(mas->tree))
- // mte_set_gap(mas->node, i, 0);
- }
- mte_set_slot(mas->node, mt_slots[bn->type] - 1, NULL);
-
+ enum maple_type mt = mte_node_type(mas->node);
+ struct maple_node *mn = mas_mn(mas);
+ unsigned long *pivots = ma_pivots(mn, mt);
+ void **slots = ma_slots(mn, mt);
+ char zero = mt_slots[mt] - bn->b_end - 1;
+
+ memset(slots + bn->b_end + 1, 0, sizeof(void *) * zero--);
+ memset(pivots + bn->b_end + 1, 0, sizeof(unsigned long *) * zero);
}
return true;