]> www.infradead.org Git - users/willy/linux.git/commitdiff
mm/gup: Use maple tree navigation instead of linked list
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 4 Jan 2021 19:56:20 +0000 (14:56 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 20 Oct 2021 20:00:34 +0000 (16:00 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/gup.c

index 886d6148d3d03afbce35cdc7352c928d00c003bc..f9710e4758994c32aa66c97c941aa7ff9673ea21 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1568,7 +1568,6 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
        long ret = 0;
 
        end = start + len;
-
        for (nstart = start; nstart < end; nstart = nend) {
                /*
                 * We want to fault in pages for [nstart; end) address range.
@@ -1577,10 +1576,10 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
                if (!locked) {
                        locked = 1;
                        mmap_read_lock(mm);
-                       vma = find_vma(mm, nstart);
+                       vma = find_vma_intersection(mm, start, end);
                } else if (nstart >= vma->vm_end)
-                       vma = vma->vm_next;
-               if (!vma || vma->vm_start >= end)
+                       vma = vma_next(mm, vma);
+               if (!vma)
                        break;
                /*
                 * Set [nstart; nend) to intersection of desired address