From: Liam R. Howlett Date: Mon, 4 Jan 2021 19:56:20 +0000 (-0500) Subject: mm/gup: Use maple tree navigation instead of linked list X-Git-Tag: howlett/maple_spf/20210118~18 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d8ce59a1093bd5733e255dc7cec6f2ce37fbbb3a;p=users%2Fjedix%2Flinux-maple.git mm/gup: Use maple tree navigation instead of linked list Signed-off-by: Liam R. Howlett --- diff --git a/mm/gup.c b/mm/gup.c index 55686fc8128e..8a69c5342909 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1445,6 +1445,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; @@ -1456,10 +1457,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