enum maple_type type)
{
if (slot > 0)
- ms->min = _ma_get_pivot(ms->node, slot - 1, type);
+ ms->min = _ma_get_pivot(ms->node, slot - 1, type) + 1;
if (slot < mt_slots[type] - 1)
ms->max = _ma_get_pivot(ms->node, slot, type);
/* Linear node type */
if (!pivot_cnt) {
min = mas->index - mas->min;
- if (mas->min)
- min--;
max = mas->last - mas->min;
do
ma_update_rcu_slot(mas->node, min++, entry);
slot = o_end + 1; // Append.
if (slot > 0)
- min = ma_get_pivot(mas->node, slot - 1);
+ min = ma_get_pivot(mas->node, slot - 1) + 1;
/* Figure out how many slots are needed for the entry. */
if (max != mas->last)
n_end++;
- if (mas->index && min != mas->index - 1)
+ if (mas->index && min != mas->index)
n_end++;
if (n_end > slot_cnt - 1 ||
- if (mas->index && min != mas->index - 1) {
+ if (mas->index && min != mas->index) {
/* When writing a NULL entry, the order must be reversed to
* ensure readers don't get incorrect data on appends
*/
max = pivot;
break;
}
- min = pivot;
+ min = pivot + 1;
}
if ((i == pivot_cnt - 1) && (mas->index > pivot))
case maple_dense:
// Linear node.
i = mas->index - mas->min;
- if (mas->min)
- i--;
goto done;
break;
}