aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/sys_i386_32.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-11-30 17:37:04 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2009-12-11 06:44:29 -0500
commitf8b7256096a20436f6d0926747e3ac3d64c81d24 (patch)
tree18bcabd1de263bd2d0f8d6b763bde8b037716c5c /arch/x86/kernel/sys_i386_32.c
parent0067bd8a55862ac9dd212bd1c4f6f5bff1ca1301 (diff)
Unify sys_mmap*
New helper - sys_mmap_pgoff(); switch syscalls to using it. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/x86/kernel/sys_i386_32.c')
-rw-r--r--arch/x86/kernel/sys_i386_32.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c
index 1884a8d12bf..dee1ff7cba5 100644
--- a/arch/x86/kernel/sys_i386_32.c
+++ b/arch/x86/kernel/sys_i386_32.c
@@ -24,31 +24,6 @@
#include <asm/syscalls.h>
-asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
- unsigned long prot, unsigned long flags,
- unsigned long fd, unsigned long pgoff)
-{
- int error = -EBADF;
- struct file *file = NULL;
- struct mm_struct *mm = current->mm;
-
- flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
- if (!(flags & MAP_ANONYMOUS)) {
- file = fget(fd);
- if (!file)
- goto out;
- }
-
- down_write(&mm->mmap_sem);
- error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
- up_write(&mm->mmap_sem);
-
- if (file)
- fput(file);
-out:
- return error;
-}
-
/*
* Perform the select(nd, in, out, ex, tv) and mmap() system
* calls. Linux/i386 didn't use to be able to handle more than
@@ -77,7 +52,7 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
if (a.offset & ~PAGE_MASK)
goto out;
- err = sys_mmap2(a.addr, a.len, a.prot, a.flags,
+ err = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags,
a.fd, a.offset >> PAGE_SHIFT);
out:
return err;