diff mbox series

[27/28] mmap: Update count_vma_pages_range() to only use one ma_state

Message ID 20201210170402.3468568-28-Liam.Howlett@Oracle.com (mailing list archive)
State New, archived
Headers show
Series RFC mm: Introducing the Maple Tree | expand

Commit Message

Liam R. Howlett Dec. 10, 2020, 5:04 p.m. UTC
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
 mm/mmap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/mm/mmap.c b/mm/mmap.c
index 284c90504b44c..7a575e6f1e7df 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -483,17 +483,15 @@  static unsigned long count_vma_pages_range(struct mm_struct *mm,
 	MA_STATE(mas, &mm->mm_mt, addr, addr);
 
 	/* Find first overlaping mapping */
-	vma = find_vma_intersection(mm, addr, end);
+	vma = mas_find(&mas, end - 1);
 	if (!vma)
 		return 0;
 
 	vm_start = vma->vm_start;
 	vm_end = vma->vm_end;
-
 	nr_pages = (min(end, vm_end) - max(addr, vm_start)) >> PAGE_SHIFT;
 
 	/* Iterate over the rest of the overlaps */
-	mas.index = mas.last = vm_end;
 	mas_for_each(&mas, vma, end) {
 		vm_start = vma->vm_start;
 		vm_end = vma->vm_end;