Skip to content

Commit

Permalink
merge do_mremap() into sys_mremap()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 31, 2012
1 parent 657bec8 commit 63a81db
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions mm/mremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(&current->mm->mmap_sem);

if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE))
goto out;

Expand Down Expand Up @@ -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(&current->mm->mmap_sem);
ret = do_mremap(addr, old_len, new_len, flags, new_addr);
up_write(&current->mm->mmap_sem);
return ret;
}

0 comments on commit 63a81db

Please sign in to comment.