aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/radix-tree/test.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2017-11-22 08:36:00 -0500
committerMatthew Wilcox <willy@infradead.org>2018-10-21 10:46:39 -0400
commite21a29552fa3f44ea41c53488875015ae70fd7f8 (patch)
tree615c10e662faa49f3910fb269d4be6d029513632 /tools/testing/radix-tree/test.c
parentshmem: Convert shmem_confirm_swap to XArray (diff)
downloadlinux-dev-e21a29552fa3f44ea41c53488875015ae70fd7f8.tar.xz
linux-dev-e21a29552fa3f44ea41c53488875015ae70fd7f8.zip
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.c22
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)
{