}
-
-
-
/** Private
* prev node entry
*/
this_gap += max - min + 1;
if (this_gap >= size) {
- /* within range and large enough */
- if (mas->last - min + 1 < size) {
- /* It is possible that the gap is
- * sufficient and within range, but
- * the size does not fit within the
- * maximum value and the min of gap
- */
+ if (mas->last - min + 1 < size)
goto next_slot;
- }
mas->min = min;
mas->max = min + this_gap - 1;
i = start;
found = true;
break;
}
+
next_slot:
if (!i)
goto ascend;
if (mas->last < min)
goto next;
-
/* index is too large for this range */
if (mas->index > max) {
mas_set_err(mas, -EBUSY);
break;
next:
- /* Not found in this node.*/
if (!i)
goto ascend;
break;
case maple_dense:
- // FIXME: find a line of nulls...
i = mas->index - mas->min;
found = true;
break;
}
-
if (!ma_is_leaf(type)) { //descend
struct maple_enode *next;
next = mas_get_rcu_slot(mas, i);
mas->min = min;
mas->max = max;
- if (!mt_is_empty(next)) {
- mas->node = next;
- i = _mas_data_end(mas, mte_node_type(next), &max);
- } else {
+ if (mt_is_empty(next))
goto ascend;
- }
+
+ mas->node = next;
+ i = _mas_data_end(mas, mte_node_type(next), &max);
}
mas_set_slot(mas, i);