linux/tools/testing/radix-tree
Ross Zwisler 21ef533931 radix-tree: add support for multi-order iterating
This enables the macros radix_tree_for_each_slot() and friends to be
used with multi-order entries.

The way that this works is that we treat all entries in a given slots[]
array as a single chunk.  If the index given to radix_tree_next_chunk()
happens to point us to a sibling entry, we will back up iter->index so
that it points to the canonical entry, and that will be the place where
we start our iteration.

As we're processing a chunk in radix_tree_next_slot(), we process
canonical entries, skip over sibling entries, and restart the chunk
lookup if we find a non-sibling indirect pointer.  This drops back to
the radix_tree_next_chunk() code, which will re-walk the tree and look
for another chunk.

This allows us to properly handle multi-order entries mixed with other
entries that are at various heights in the radix tree.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Kirill Shutemov <kirill.shutemov@linux.intel.com>
Cc: Jan Kara <jack@suse.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-20 17:58:30 -07:00
..
generated radix-tree: add support for multi-order iterating 2016-05-20 17:58:30 -07:00
linux radix-tree: add support for multi-order iterating 2016-05-20 17:58:30 -07:00
.gitignore radix tree test harness 2016-03-17 15:09:34 -07:00
find_next_bit.c radix tree test harness 2016-03-17 15:09:34 -07:00
linux.c radix tree test harness 2016-03-17 15:09:34 -07:00
main.c radix tree test suite: start adding multiorder tests 2016-05-20 17:58:30 -07:00
Makefile radix tree test suite: start adding multiorder tests 2016-05-20 17:58:30 -07:00
multiorder.c radix-tree: fix multiorder BUG_ON in radix_tree_insert 2016-05-20 17:58:30 -07:00
rcupdate.c radix tree test harness 2016-03-17 15:09:34 -07:00
regression.h radix-tree tests: add regression3 test 2016-03-17 15:09:34 -07:00
regression1.c radix tree test harness 2016-03-17 15:09:34 -07:00
regression2.c radix tree test suite: allow testing other fan-out values 2016-05-20 17:58:30 -07:00
regression3.c radix-tree tests: add test for radix_tree_iter_next 2016-03-17 15:09:34 -07:00
tag_check.c radix tree test harness 2016-03-17 15:09:34 -07:00
test.c radix tree test suite: start adding multiorder tests 2016-05-20 17:58:30 -07:00
test.h radix tree test suite: start adding multiorder tests 2016-05-20 17:58:30 -07:00