From: Liam R. Howlett Date: Mon, 4 Jan 2021 19:25:19 +0000 (-0500) Subject: parisc: Remove mmap linked list from cache handling X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=31d4dc0e6f43f4488081253bff71e96970a5ae04;p=users%2Fjedix%2Flinux-maple.git parisc: Remove mmap linked list from cache handling Use the VMA iterator instead. Signed-off-by: Liam R. Howlett --- diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 39e02227e231..50e94d44a963 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c @@ -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;