mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
page cache: Convert find_get_pages_contig to XArray
There's no direct replacement for radix_tree_for_each_contig() in the XArray API as it's an unusual thing to do. Instead, open-code a loop using xas_next(). This removes the only user of radix_tree_for_each_contig() so delete the iterator from the API and the test suite code for it. Signed-off-by: Matthew Wilcox <willy@infradead.org>
This commit is contained in:
parent
fd1b3cee2a
commit
3ece58a270
4 changed files with 22 additions and 72 deletions
|
@ -69,21 +69,6 @@ void regression3_test(void)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
radix_tree_delete(&root, 1);
|
||||
|
||||
first = true;
|
||||
radix_tree_for_each_contig(slot, &root, &iter, 0) {
|
||||
printv(2, "contig %ld %p\n", iter.index, *slot);
|
||||
if (first) {
|
||||
radix_tree_insert(&root, 1, ptr);
|
||||
first = false;
|
||||
}
|
||||
if (radix_tree_deref_retry(*slot)) {
|
||||
printv(2, "retry at %ld\n", iter.index);
|
||||
slot = radix_tree_iter_retry(&iter);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
radix_tree_for_each_slot(slot, &root, &iter, 0) {
|
||||
printv(2, "slot %ld %p\n", iter.index, *slot);
|
||||
|
@ -93,14 +78,6 @@ void regression3_test(void)
|
|||
}
|
||||
}
|
||||
|
||||
radix_tree_for_each_contig(slot, &root, &iter, 0) {
|
||||
printv(2, "contig %ld %p\n", iter.index, *slot);
|
||||
if (!iter.index) {
|
||||
printv(2, "next at %ld\n", iter.index);
|
||||
slot = radix_tree_iter_resume(slot, &iter);
|
||||
}
|
||||
}
|
||||
|
||||
radix_tree_tag_set(&root, 0, 0);
|
||||
radix_tree_tag_set(&root, 1, 0);
|
||||
radix_tree_for_each_tagged(slot, &root, &iter, 0, 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue