diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2017-03-22 06:37:01 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-04-01 13:12:28 +0300 |
commit | fbfef9027c2a7ad9277755509fdb849dbccfe8c1 (patch) | |
tree | f44258e7f2972d130c9fa4f80cdb969d0495f4f3 /arch/powerpc/mm/mmap.c | |
parent | 82228e362f9b7f4b876d0fbb1036c235797c6b1d (diff) | |
download | linux-fbfef9027c2a7ad9277755509fdb849dbccfe8c1.tar.xz |
powerpc/mm: Switch some TASK_SIZE checks to use mm_context addr_limit
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/mmap.c')
-rw-r--r-- | arch/powerpc/mm/mmap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c index a5d9ef59debe..6e9fead92969 100644 --- a/arch/powerpc/mm/mmap.c +++ b/arch/powerpc/mm/mmap.c @@ -97,7 +97,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, struct vm_area_struct *vma; struct vm_unmapped_area_info info; - if (len > TASK_SIZE - mmap_min_addr) + if (len > mm->context.addr_limit - mmap_min_addr) return -ENOMEM; if (flags & MAP_FIXED) @@ -106,7 +106,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, if (addr) { addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && + if (mm->context.addr_limit - len >= addr && addr >= mmap_min_addr && (!vma || addr + len <= vma->vm_start)) return addr; } @@ -114,7 +114,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, info.flags = 0; info.length = len; info.low_limit = mm->mmap_base; - info.high_limit = TASK_SIZE; + info.high_limit = mm->context.addr_limit; info.align_mask = 0; return vm_unmapped_area(&info); } @@ -132,7 +132,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, struct vm_unmapped_area_info info; /* requested length too big for entire address space */ - if (len > TASK_SIZE - mmap_min_addr) + if (len > mm->context.addr_limit - mmap_min_addr) return -ENOMEM; if (flags & MAP_FIXED) @@ -142,7 +142,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, if (addr) { addr = PAGE_ALIGN(addr); vma = find_vma(mm, addr); - if (TASK_SIZE - len >= addr && addr >= mmap_min_addr && + if (mm->context.addr_limit - len >= addr && addr >= mmap_min_addr && (!vma || addr + len <= vma->vm_start)) return addr; } @@ -164,7 +164,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, VM_BUG_ON(addr != -ENOMEM); info.flags = 0; info.low_limit = TASK_UNMAPPED_BASE; - info.high_limit = TASK_SIZE; + info.high_limit = mm->context.addr_limit; addr = vm_unmapped_area(&info); } |