if (mt_is_alloc(mas->tree))
mas_update_gap(mas, false);
}
-static inline void mast_new_root(struct maple_subtree_state *mast,
+static inline bool mast_new_root(struct maple_subtree_state *mast,
struct ma_state *mas)
{
unsigned long range_min, range_max;
+ if (mast->l->min || mast->l->max != ULONG_MAX)
+ return false;
mas_mn(mast->l)->parent =
ma_parent_ptr(((unsigned long)mas->tree | MA_ROOT_PARENT));
mast_consume(mast);
} while (!mte_is_root(mast->orig_l->node));
}
+
mat_add(mast->free, mast->orig_l->node);
mas_dup_state(mast->orig_l, mast->l);
+ return true;
}
/* Private
*
memset(mast->bn, 0, sizeof(struct maple_big_node));
mast->orig_l->depth++;
- if (!l_mas.min && l_mas.max == ULONG_MAX) {
- mast_new_root(mast, mas);
+ if (mast_new_root(mast, mas))
goto new_root;
- }
mast_ascend_free(mast);
/* Set up the right side of things */