From: Liam R. Howlett Date: Fri, 11 Oct 2019 15:14:55 +0000 (-0400) Subject: maple_tree: Fix mas_load issues X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=48bb10e19cf26933dc2b8d924e12deb64b47ee4f;p=users%2Fjedix%2Flinux-maple.git maple_tree: Fix mas_load issues 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 --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 50ee13a0f83a..3f696a1eaec1 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -16,36 +16,6 @@ #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);