Lock the tree before beginning the iteration and unlock it after we've
finished. Also destroy the tree so subsequent users of the tree aren't
confused by the detritus from this test.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
/* Test mas_pause */
val = 0;
- mas_reset(&mas);
- mas.index = val;
+ mas_set(&mas, val);
+ mas_lock(&mas);
mas_for_each(&mas, entry, ULONG_MAX) {
if (val != 64)
MT_BUG_ON(mt, xa_mk_value(val) != entry);
mas_lock(&mas);
}
}
+ mas_unlock(&mas);
val = 0;
max = 300; // A value big enough to include XA_ZERO_ENTRY at 64.
val = 1;
}
-
+ mtree_destroy(mt);
}
mtree_destroy(mt);
}
+
static noinline void check_ranges(struct maple_tree *mt)
{
unsigned long r[] = {