#define ma_mnode_ptr(x) ((struct maple_node *)(x))
#define ma_enode_ptr(x) ((struct maple_enode *)(x))
-/**
- * mas_for_each() - Iterate over a range of the maple tree.
- * @mas: Maple Tree operation state (maple_state)
- * @entry: Entry retrieved from the tree
- * @max: maximum index to retrieve from the tree
- *
- * When returned, mas->index and mas->last will hold the entire range for the
- * entry.
- *
- * Note: may return the zero entry.
- *
- */
-#define mas_for_each(mas, entry, max) \
- while ((entry = mas_find(mas, max)) != NULL)
-
-/**
- * mt_for_each - Searches for an entry starting at index until max.
- *
- *
- *
- * Note: Will not return the zero entry.
- *
- *
- */
-#define mt_for_each(tree, entry, index, max) \
- for (entry = mt_find(mt, index, max); \
- entry; entry = mt_find_after(mt, &index, max))
-
-
-
static struct kmem_cache *maple_node_cache;
unsigned long mt_max[] = {
void *mas_load(struct ma_state *mas)
{
- void *entry = mas_walk(&mas);
+ void *entry = mas_walk(mas);
if (xa_is_zero(entry) || mt_is_empty(entry))
return NULL;
MA_STATE(mas, mt, index, index);
rcu_read_lock();
- entry = mas_load(mas);
+ entry = mas_load(&mas);
rcu_read_unlock();
- return mas_load(mas);
+ return entry;
}
EXPORT_SYMBOL(mtree_load);