diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-30 11:32:04 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-30 21:04:57 -0400 |
commit | 63a81db13205f21047a0799adfd3a2419f190577 (patch) | |
tree | cda25987d6e331cb026383f50e351bd9f5f66934 /mm/mremap.c | |
parent | 657bec850ff98b82b3a617b588a6523487344ccc (diff) |
merge do_mremap() into sys_mremap()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/mremap.c')
-rw-r--r-- | mm/mremap.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/mm/mremap.c b/mm/mremap.c index db8d983b5a7..169c53b8774 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -432,15 +432,17 @@ static int vma_expandable(struct vm_area_struct *vma, unsigned long delta) * MREMAP_FIXED option added 5-Dec-1999 by Benjamin LaHaise * This option implies MREMAP_MAYMOVE. */ -unsigned long do_mremap(unsigned long addr, - unsigned long old_len, unsigned long new_len, - unsigned long flags, unsigned long new_addr) +SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, + unsigned long, new_len, unsigned long, flags, + unsigned long, new_addr) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned long ret = -EINVAL; unsigned long charged = 0; + down_write(¤t->mm->mmap_sem); + if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE)) goto out; @@ -538,17 +540,6 @@ unsigned long do_mremap(unsigned long addr, out: if (ret & ~PAGE_MASK) vm_unacct_memory(charged); - return ret; -} - -SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, - unsigned long, new_len, unsigned long, flags, - unsigned long, new_addr) -{ - unsigned long ret; - - down_write(¤t->mm->mmap_sem); - ret = do_mremap(addr, old_len, new_len, flags, new_addr); up_write(¤t->mm->mmap_sem); return ret; } |