}
}
/*
- * __mas_walk(): Locates a value and sets the mas->node and slot accordingly.
- * range_min and range_max are set to the range which the entry is valid.
+ * mas_descend_walk(): Locates a value and sets the mas->node and slot
+ * accordingly. range_min and range_max are set to the range which the entry is
+ * valid.
* @mas: The maple state
* @*range_min: A pointer to store the minimum of the range
* @*range_max: A pointer to store the maximum of the range
*
* Return: true if pointing to a valid node and offset. False otherwise.
*/
-static inline bool __mas_walk(struct ma_state *mas, unsigned long *range_min,
- unsigned long *range_max)
+static inline bool mas_descend_walk(struct ma_state *mas,
+ unsigned long *range_min, unsigned long *range_max)
{
struct maple_enode *next;
struct maple_node *node;
r_mas.index = r_mas.last;
r_mas.offset = 0;
- __mas_walk(&r_mas, &range_min, &range_max);
+ mas_descend_walk(&r_mas, &range_min, &range_max);
r_mas.last = r_mas.index = mas->last;
/* Set up left side. */
l_mas = *mas;
l_mas.offset = 0;
- __mas_walk(&l_mas, &range_min, &range_max);
+ mas_descend_walk(&l_mas, &range_min, &range_max);
content = mas_get_slot(&l_mas, l_mas.offset);
if (!entry) {
}
/*
- * _mas_walk() - Walk to @mas->index and set the range values.
+ * mas_tree_walk() - Walk to @mas->index and set the range values.
* @mas: The maple state.
* @*range_min: The minimum range to be set.
* @*range_max: The maximum range to be set.
*
* Return: True if a value exists, false otherwise.
*/
-static inline bool _mas_walk(struct ma_state *mas, unsigned long *range_min,
- unsigned long *range_max)
+static inline bool mas_tree_walk(struct ma_state *mas, unsigned long *range_min,
+ unsigned long *range_max)
{
void *entry;
goto not_found;
}
- ret = __mas_walk(mas, range_min, range_max);
+ ret = mas_descend_walk(mas, range_min, range_max);
if (unlikely(mte_dead_node(mas->node))) {
mas->node = MAS_START;
goto retry;
unsigned long range_max, range_min;
mas_set(mas, index);
- _mas_walk(mas, &range_min, &range_max);
+ mas_tree_walk(mas, &range_min, &range_max);
mas->last = range_max;
mas->index = range_min;
}
if (mas_is_none(mas) || mas_is_paused(mas))
mas->node = MAS_START;
retry:
- if (_mas_walk(mas, range_min, range_max))
+ if (mas_tree_walk(mas, range_min, range_max))
if (unlikely(mas->node == MAS_ROOT))
return mas_root(mas);
if (mas_is_start(mas))
mas_start(mas);
- __mas_walk(mas, &range_min, &range_max);
+ mas_descend_walk(mas, &range_min, &range_max);
end = mas_data_end(mas) + 1;
if (end < mt_min_slot_count(mas->node) - 1)
mas_destroy_rebalance(mas, end);
return NULL;
rcu_read_lock();
- leaf = _mas_walk(&mas, &range_start, &range_end);
+ leaf = mas_tree_walk(&mas, &range_start, &range_end);
if (leaf == true && mas.offset != MAPLE_NODE_SLOTS)
entry = mas_get_slot(&mas, mas.offset);