um: remove vma linked list walk
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 6 Sep 2022 19:48:56 +0000 (19:48 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 27 Sep 2022 02:46:20 +0000 (19:46 -0700)
Use the VMA iterator instead.

Link: https://lkml.kernel.org/r/20220906194824.2110408-40-Liam.Howlett@oracle.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Tested-by: Yu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/um/kernel/tlb.c

index bc38f79..ad44917 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;
+       VMA_ITERATOR(vmi, mm, 0);
 
-       while (vma != NULL) {
+       for_each_vma(vmi, vma)
                fix_range(mm, vma->vm_start, vma->vm_end, 1);
-               vma = vma->vm_next;
-       }
 }