mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Signed-off-by: Matthew Wilcox <[email protected]> Cc: Konstantin Khlebnikov <[email protected]> Cc: Kirill Shutemov <[email protected]> Cc: Jan Kara <[email protected]> Cc: Neil Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
7b60e9ad59
commit
21ef533931
4 changed files with 102 additions and 41 deletions
3
tools/testing/radix-tree/generated/autoconf.h
Normal file
3
tools/testing/radix-tree/generated/autoconf.h
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#define CONFIG_RADIX_TREE_MULTIORDER 1
|
||||
#define CONFIG_SHMEM 1
|
||||
#define CONFIG_SWAP 1
|
||||
|
|
@ -8,10 +8,7 @@
|
|||
#include <limits.h>
|
||||
|
||||
#include "../../include/linux/compiler.h"
|
||||
|
||||
#define CONFIG_RADIX_TREE_MULTIORDER
|
||||
#define CONFIG_SHMEM
|
||||
#define CONFIG_SWAP
|
||||
#include "../../../include/linux/kconfig.h"
|
||||
|
||||
#define RADIX_TREE_MAP_SHIFT 3
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue