Lines Matching refs:new_len
618 unsigned long new_len, unsigned long new_addr, in move_vma() argument
662 if (security_vm_enough_memory_mm(mm, new_len >> PAGE_SHIFT)) in move_vma()
667 new_vma = copy_vma(&vma, new_addr, new_len, new_pgoff, in move_vma()
671 vm_unacct_memory(new_len >> PAGE_SHIFT); in move_vma()
692 old_len = new_len; in move_vma()
718 vm_stat_account(mm, vma->vm_flags, new_len >> PAGE_SHIFT); in move_vma()
750 mm->locked_vm += new_len >> PAGE_SHIFT; in move_vma()
767 unsigned long old_len, unsigned long new_len, unsigned long flags, in vma_to_resize() argument
802 if (new_len == old_len) in vma_to_resize()
808 if (pgoff + (new_len >> PAGE_SHIFT) < pgoff) in vma_to_resize()
818 locked += new_len - old_len; in vma_to_resize()
824 (new_len - old_len) >> PAGE_SHIFT)) in vma_to_resize()
828 unsigned long charged = (new_len - old_len) >> PAGE_SHIFT; in vma_to_resize()
838 unsigned long new_addr, unsigned long new_len, bool *locked, in mremap_to() argument
852 if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len) in mremap_to()
856 if (addr + old_len > new_addr && new_addr + new_len > addr) in mremap_to()
877 ret = do_munmap(mm, new_addr, new_len, uf_unmap_early); in mremap_to()
882 if (old_len >= new_len) { in mremap_to()
883 ret = do_munmap(mm, addr+new_len, old_len - new_len, uf_unmap); in mremap_to()
884 if (ret && old_len != new_len) in mremap_to()
886 old_len = new_len; in mremap_to()
889 vma = vma_to_resize(addr, old_len, new_len, flags, &charged); in mremap_to()
908 ret = get_unmapped_area(vma->vm_file, new_addr, new_len, vma->vm_pgoff + in mremap_to()
918 ret = move_vma(vma, addr, old_len, new_len, new_addr, locked, flags, uf, in mremap_to()
952 unsigned long, new_len, unsigned long, flags, in SYSCALL_DEFINE5() argument
988 (!(flags & MREMAP_MAYMOVE) || old_len != new_len)) in SYSCALL_DEFINE5()
996 new_len = PAGE_ALIGN(new_len); in SYSCALL_DEFINE5()
1003 if (!new_len) in SYSCALL_DEFINE5()
1010 ret = mremap_to(addr, old_len, new_addr, new_len, in SYSCALL_DEFINE5()
1022 if (old_len >= new_len) { in SYSCALL_DEFINE5()
1025 retval = __do_munmap(mm, addr+new_len, old_len - new_len, in SYSCALL_DEFINE5()
1027 if (retval < 0 && old_len != new_len) { in SYSCALL_DEFINE5()
1040 vma = vma_to_resize(addr, old_len, new_len, flags, &charged); in SYSCALL_DEFINE5()
1050 if (vma_expandable(vma, new_len - old_len)) { in SYSCALL_DEFINE5()
1051 int pages = (new_len - old_len) >> PAGE_SHIFT; in SYSCALL_DEFINE5()
1053 if (vma_adjust(vma, vma->vm_start, addr + new_len, in SYSCALL_DEFINE5()
1080 new_addr = get_unmapped_area(vma->vm_file, 0, new_len, in SYSCALL_DEFINE5()
1089 ret = move_vma(vma, addr, old_len, new_len, new_addr, in SYSCALL_DEFINE5()
1101 if (locked && new_len > old_len) in SYSCALL_DEFINE5()
1102 mm_populate(new_addr + old_len, new_len - old_len); in SYSCALL_DEFINE5()