unsigned long min; /* The smallest index to be found in %node */
unsigned long max; /* The largest index to be found in %node */
unsigned long slot_idx; /* The slot index from %node */
- unsigned long pslot_idx; /* The slot index from the parent %node */
struct maple_node *alloc; /* Allocated for this operation */
short flags; /* Different stuff */
};
{
struct maple_node_4 *mn4 = &ms->node->map4;
- ms->pslot_idx = ms->slot_idx;
ms->slot_idx = ms->index - ms->min;
return rcu_dereference(mn4->slot[ms->slot_idx]);
}
break;
} while (i++ < MAPLE_NODE64_MAX_SLOT - 1);
- ms->pslot_idx = ms->slot_idx;
ms->slot_idx = i;
return rcu_dereference(mn64->slot[i]);
}
if (r_entry != NULL) {
RCU_INIT_POINTER(mn->map64.slot[0], r_entry);
mn->map64.pivot[0] = 1;
- ms->pslot_idx = 0;
ms->slot_idx = 1;
}
left->parent = full->parent;
right->parent = full->parent;
+ /* Get the slot_idx to overwrite in the parent */
+ ms->node = full->parent;
+ _maple_walk_64(ms, ms->index);
/* Shift the data over */
- maple_shift_64(target, ms->pslot_idx, 1);
+ maple_shift_64(target, ms->slot_idx, 1);
/* Overwrite the duplicate slot data with the new right node */
- target->slot[ms->pslot_idx + 1] = ma_mk_node(right);
+ target->slot[ms->slot_idx + 1] = ma_mk_node(right);
/* Overwrite the first pivot with the new value. This is fine
* as the current slot has valid entries for this pivot */
- target->pivot[ms->pslot_idx] = left64->pivot[l_end];
+ target->pivot[ms->slot_idx] = left64->pivot[l_end];
/* Set the first slot to the node with less pivots */
- target->slot[ms->pslot_idx] = ma_mk_node(left);
+ target->slot[ms->slot_idx] = ma_mk_node(left);
/* Update the new nodes children's parent setting */
maple_update_parent(left);
maple_update_parent(right);