return false;
if (!mte_is_root(mas->node) && (new_end <= mt_min_slots[mt]) &&
- !(mas->mas_flags & MA_STATE_ADVANCED_OP)) {// not enough data.
+ !(mas->mas_flags & MA_STATE_ADVANCED_OP)) // not enough data.
return false;
- }
// set up node.
if (mt_in_rcu(mas->tree)) {
if (offset + 1 >= mt_slots[mt]) // out of room.
return false;
- lmax = mas_logical_pivot(mas, pivots, offset + 1, mt);
if (max > mas->last) // going to split a single entry.
goto try_node_store;
+ lmax = mas_logical_pivot(mas, pivots, offset + 1, mt);
if (lmax < mas->last) // going to overwrite too many slots.
goto try_node_store;
if (!entry) {
unsigned long rmin, rmax;
+ enum maple_type mt = mte_node_type(mas->node);
+ unsigned long *pivots = ma_pivots(mas_mn(mas),mt);
+
MA_STATE(r_mas, mas->tree, mas->last, mas->last);
mas_set_offset(&r_mas, offset);
mas_extend_null(mas, &r_mas);
mas->last = r_mas.last;
offset = mas_offset(mas);
- r_max = mas_safe_pivot(mas, mas_offset(mas));
+ r_min = mas_safe_min(mas, pivots, offset);
+ r_max = _mas_safe_pivot(mas, pivots, offset, mt);
}
end = mas_data_end(mas);