]> www.infradead.org Git - users/jedix/linux-maple.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)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 24 Jun 2021 20:04:24 +0000 (16:04 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/gup.c

index 29a0c7d87024114bbdc0a9215cf3737f99a268e7..0f375f6ef0a38204807608b266250672820d24c4 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1551,6 +1551,7 @@ int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)
        struct vm_area_struct *vma = NULL;
        int locked = 0;
        long ret = 0;
+       MA_STATE(mas, &mm->mm_mt, start, start);
 
        end = start + len;
 
@@ -1562,10 +1563,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 = mas_find(&mas, end);
                } else if (nstart >= vma->vm_end)
-                       vma = vma->vm_next;
-               if (!vma || vma->vm_start >= end)
+                       vma = mas_next(&mas, end);
+               if (!vma)
                        break;
                /*
                 * Set [nstart; nend) to intersection of desired address