]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
s390: Remove vma linked list walks
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 4 Jan 2021 19:29:19 +0000 (14:29 -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/s390/kernel/vdso.c
arch/s390/mm/gmap.c

index 99694260cac97bc618bd7cce2c2672fdf9053604..66f7e7c63632c4714ef3ddb46399819203d01e81 100644 (file)
@@ -68,10 +68,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 4d3b33ce81c62f83c69961a2ca7d9d03ae821aea..be0bf9830506981323e5c0e9a00a72a8283845ad 100644 (file)
@@ -2501,8 +2501,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);
@@ -2570,8 +2571,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)