]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xtensa: Remove vma linked list walks
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 4 Jan 2021 19:30:59 +0000 (14:30 -0500)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 26 Nov 2021 19:50:31 +0000 (14:50 -0500)
Use the VMA iterator instead.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
arch/xtensa/kernel/syscall.c

index 201356faa7e6e01d19bedf684194f44f076b6409..20ec9534e01f9cd7253adfaaab40b94e72ae33b1 100644 (file)
@@ -58,6 +58,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
                unsigned long len, unsigned long pgoff, unsigned long flags)
 {
        struct vm_area_struct *vmm;
+       VMA_ITERATOR(vmi, mm, addr);
 
        if (flags & MAP_FIXED) {
                /* We do not accept a shared mapping if it would violate
@@ -79,7 +80,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
        else
                addr = PAGE_ALIGN(addr);
 
-       for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
+       for_each_vma(vmi, vmm) {
                /* At this point:  (!vmm || addr < vmm->vm_end). */
                if (TASK_SIZE - len < addr)
                        return -ENOMEM;