]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arch/xtensa: Use maple tree iterators for unmapped area
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>
Thu, 14 Jan 2021 01:33:56 +0000 (20:33 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
arch/xtensa/kernel/syscall.c

index 2c415fce6801ac448f9b13c47e092fe21234911f..26ec2e67879add595201160e2085e504e8e516ea 100644 (file)
@@ -62,6 +62,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;
+       MA_STATE(mas, &mm->mm_mt, addr, addr);
 
        if (flags & MAP_FIXED) {
                /* We do not accept a shared mapping if it would violate
@@ -83,7 +84,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) {
+       mas_for_each(&mas, vmm, ULONG_MAX) {
                /* At this point:  (!vmm || addr < vmm->vm_end). */
                if (TASK_SIZE - len < addr)
                        return -ENOMEM;