]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arch/s390: Use maple tree iterators instead of linked list.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 4 Jan 2021 19:29:19 +0000 (14:29 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Thu, 28 Jan 2021 17:38:11 +0000 (12:38 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
arch/s390/mm/gmap.c

index 9bb2c7512cd540e85dfe461e8cc154b22d0440cd..d8f3f4d409652c889ba8b0688fa86f86d8427ffa 100644 (file)
@@ -2502,8 +2502,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;
+       MA_STATE(mas, &mm->mm_mt, 0, 0);
 
-       for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) {
+       mas_for_each(&mas, vma, ULONG_MAX) {
                vma->vm_flags &= ~VM_HUGEPAGE;
                vma->vm_flags |= VM_NOHUGEPAGE;
                walk_page_vma(vma, &thp_split_walk_ops, NULL);
@@ -2571,8 +2572,9 @@ int gmap_mark_unmergeable(void)
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
        int ret;
+       MA_STATE(mas, &mm->mm_mt, 0, 0);
 
-       for (vma = mm->mmap; vma; vma = vma->vm_next) {
+       mas_for_each(&mas, vma, ULONG_MAX) {
                ret = ksm_madvise(vma, vma->vm_start, vma->vm_end,
                                  MADV_UNMERGEABLE, &vma->vm_flags);
                if (ret)