]> git.baikalelectronics.ru Git - kernel.git/commitdiff
s390: remove vma linked list walks
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 6 Sep 2022 19:48:54 +0000 (19:48 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 27 Sep 2022 02:46:19 +0000 (19:46 -0700)
Use the VMA iterator instead.

Link: https://lkml.kernel.org/r/20220906194824.2110408-35-Liam.Howlett@oracle.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
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: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/s390/kernel/vdso.c
arch/s390/mm/gmap.c

index 5075cde77b29202977f7aad304267f49b6aea33e..535099f2736dab852b318ee0b443bb3d2fd3dbb5 100644 (file)
@@ -69,10 +69,11 @@ static struct page *find_timens_vvar_page(struct vm_area_struct *vma)
 int vdso_join_timens(struct task_struct *task, struct time_namespace *ns)
 {
        struct mm_struct *mm = task->mm;
+       VMA_ITERATOR(vmi, mm, 0);
        struct vm_area_struct *vma;
 
        mmap_read_lock(mm);
-       for (vma = mm->mmap; vma; vma = vma->vm_next) {
+       for_each_vma(vmi, vma) {
                unsigned long size = vma->vm_end - vma->vm_start;
 
                if (!vma_is_special_mapping(vma, &vvar_mapping))
index 62758cb5872f1da06abbca4dd21cbe2e107ec13a..02d15c8dc92e994692f2322cf3232f85a032f76a 100644 (file)
@@ -2515,8 +2515,9 @@ static const struct mm_walk_ops thp_split_walk_ops = {
 static inline void thp_split_mm(struct mm_struct *mm)
 {
        struct vm_area_struct *vma;
+       VMA_ITERATOR(vmi, mm, 0);
 
-       for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) {
+       for_each_vma(vmi, vma) {
                vma->vm_flags &= ~VM_HUGEPAGE;
                vma->vm_flags |= VM_NOHUGEPAGE;
                walk_page_vma(vma, &thp_split_walk_ops, NULL);
@@ -2584,8 +2585,9 @@ int gmap_mark_unmergeable(void)
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
        int ret;
+       VMA_ITERATOR(vmi, mm, 0);
 
-       for (vma = mm->mmap; vma; vma = vma->vm_next) {
+       for_each_vma(vmi, vma) {
                ret = ksm_madvise(vma, vma->vm_start, vma->vm_end,
                                  MADV_UNMERGEABLE, &vma->vm_flags);
                if (ret)