}
/* Private
*
- * Insert entry into a node.
+ * Insert entry into a node that is not visible to readers.
*
* This is done by:
* 1. Calculating the range of slot.
if (min != ms->index - 1)
n_end++;
-
/* Copy the data over */
while (o_end >= slot) {
RCU_INIT_POINTER(mr64->slot[n_end],
mr64->slot[o_end]);
- if (n_end < MAPLE_RANGE64_SLOTS - 2)
+ if (n_end < MAPLE_RANGE64_SLOTS - 1)
mr64->pivot[n_end] = mr64->pivot[o_end];
n_end--;
o_end--;
mn = ma_next_alloc(mas);
dst = &mn->mr64;
- for (s_slot = 0; s_slot < MAPLE_RANGE64_SLOTS; s_slot++) {
+ for (s_slot = 0; s_slot < MAPLE_RANGE64_SLOTS - 1; s_slot++) {
if (last == src->pivot[s_slot])
continue;
int i = 0;
mr64 = &mt_to_node(ms->node)->mr64;
- for (i = 0; i < MAPLE_RANGE64_SLOTS - 1; i++) {
+ for (i = 0; i <= MAPLE_RANGE64_SLOTS - 1; i++) {
if (i != 0 && mr64->pivot[i] == 0) {
ma_set_slot(ms, MAPLE_NODE_SLOTS);
return false;
}
if (i == MAPLE_RANGE64_SLOTS - 2) {
- if (val <= mr64->pivot[i])
+ if (val > mr64->pivot[i])
i++;
}
#ifdef MT_DEBUG
+void mt_dump_node(void *entry, unsigned long min, unsigned long max,
+ unsigned int depth);
void mt_dump_range(unsigned long min, unsigned long max)
{
if (min == max)