]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix mas_load issues
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 11 Oct 2019 15:14:55 +0000 (11:14 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 11 Oct 2019 15:14:55 +0000 (11:14 -0400)
Previous commit included incomplete work of mas_load by accident.  This
fixes the build failure and successfully runs all tests.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 50ee13a0f83addefe4a3ad32734ba2bdaadd003e..3f696a1eaec1b2addc675e49d1ef6a02f83d1090 100644 (file)
 #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[] = {
@@ -3340,7 +3310,7 @@ static inline int mas_dead_node(struct ma_state *mas, unsigned long index)
 
 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;
 
@@ -4039,9 +4009,9 @@ void *mtree_load(struct maple_tree *mt, unsigned long index)
 
        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);