diff options
author | Matthew Wilcox <willy@infradead.org> | 2017-11-22 16:36:00 +0300 |
---|---|---|
committer | Matthew Wilcox <willy@infradead.org> | 2018-10-21 17:46:39 +0300 |
commit | e21a29552fa3f44ea41c53488875015ae70fd7f8 (patch) | |
tree | 615c10e662faa49f3910fb269d4be6d029513632 /tools/testing/radix-tree/test.c | |
parent | a12831bf4293d38518e41b80dd897af0122bb268 (diff) | |
download | linux-e21a29552fa3f44ea41c53488875015ae70fd7f8.tar.xz |
shmem: Convert find_swap_entry to XArray
This is a 1:1 conversion. The major part of this patch is converting
the test framework from userspace to kernel space and mirroring the
algorithm now used in find_swap_entry().
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'tools/testing/radix-tree/test.c')
-rw-r--r-- | tools/testing/radix-tree/test.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/tools/testing/radix-tree/test.c b/tools/testing/radix-tree/test.c index 70ddf964d51c..470419bfd49d 100644 --- a/tools/testing/radix-tree/test.c +++ b/tools/testing/radix-tree/test.c @@ -209,28 +209,6 @@ int tag_tagged_items(struct radix_tree_root *root, pthread_mutex_t *lock, return tagged; } -/* Use the same pattern as find_swap_entry() in mm/shmem.c */ -unsigned long find_item(struct radix_tree_root *root, void *item) -{ - struct radix_tree_iter iter; - void **slot; - unsigned long found = -1; - unsigned long checked = 0; - - radix_tree_for_each_slot(slot, root, &iter, 0) { - if (*slot == item) { - found = iter.index; - break; - } - checked++; - if ((checked % 4) != 0) - continue; - slot = radix_tree_iter_resume(slot, &iter); - } - - return found; -} - static int verify_node(struct radix_tree_node *slot, unsigned int tag, int tagged) { |