]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
um: Remove vma linked list walk
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 16 Mar 2021 19:56:41 +0000 (15:56 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 26 Nov 2021 19:50:31 +0000 (14:50 -0500)
Use the VMA iterator instead.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
arch/um/kernel/tlb.c

index bc38f79ca3a38242a5165685910528e18c1f98a4..25f043037d7698d97f5b8ae53b06dd781195f96c 100644 (file)
@@ -584,21 +584,19 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
 
 void flush_tlb_mm(struct mm_struct *mm)
 {
-       struct vm_area_struct *vma = mm->mmap;
+       struct vm_area_struct *vma;
+       VMA_ITERATOR(vmi, mm, 0);
 
-       while (vma != NULL) {
+       for_each_vma(vmi, vma)
                fix_range(mm, vma->vm_start, vma->vm_end, 0);
-               vma = vma->vm_next;
-       }
 }
 
 void force_flush_all(void)
 {
        struct mm_struct *mm = current->mm;
-       struct vm_area_struct *vma = mm->mmap;
+       struct vm_area_struct *vma;
+       MA_STATE(mas, &mm->mm_mt, 0, 0);
 
-       while (vma != NULL) {
+       mas_for_each(&mas, vma, ULONG_MAX)
                fix_range(mm, vma->vm_start, vma->vm_end, 1);
-               vma = vma->vm_next;
-       }
 }