]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
parisc: Remove mmap linked list from cache handling
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 4 Jan 2021 19:25:19 +0000 (14:25 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Sat, 30 Oct 2021 03:38:43 +0000 (23:38 -0400)
Use the VMA iterator instead.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
arch/parisc/kernel/cache.c

index 39e02227e231007040c37868aa23e4c4517703d9..50e94d44a963fe8fdebf0b2484cf27d574c1c878 100644 (file)
@@ -519,9 +519,11 @@ static inline unsigned long mm_total_size(struct mm_struct *mm)
 {
        struct vm_area_struct *vma;
        unsigned long usize = 0;
+       VMA_ITERATOR(vmi, mm, 0);
 
-       for (vma = mm->mmap; vma; vma = vma->vm_next)
+       for_each_vma(vmi, vma)
                usize += vma->vm_end - vma->vm_start;
+
        return usize;
 }
 
@@ -547,6 +549,7 @@ void flush_cache_mm(struct mm_struct *mm)
 {
        struct vm_area_struct *vma;
        pgd_t *pgd;
+       VMA_ITERATOR(vmi, mm, 0);
 
        /* Flushing the whole cache on each cpu takes forever on
           rp3440, etc.  So, avoid it if the mm isn't too big.  */
@@ -559,7 +562,7 @@ void flush_cache_mm(struct mm_struct *mm)
        }
 
        if (mm->context == mfsp(3)) {
-               for (vma = mm->mmap; vma; vma = vma->vm_next) {
+               for_each_vma(vmi, vma) {
                        flush_user_dcache_range_asm(vma->vm_start, vma->vm_end);
                        if (vma->vm_flags & VM_EXEC)
                                flush_user_icache_range_asm(vma->vm_start, vma->vm_end);
@@ -569,7 +572,7 @@ void flush_cache_mm(struct mm_struct *mm)
        }
 
        pgd = mm->pgd;
-       for (vma = mm->mmap; vma; vma = vma->vm_next) {
+       for_each_vma(vmi, vma) {
                unsigned long addr;
 
                for (addr = vma->vm_start; addr < vma->vm_end;