summaryrefslogtreecommitdiff
path: root/arch/x86/ia32/sys_ia32.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-11 20:23:29 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-11 20:23:29 (GMT)
commitaad3bf04dca5a2147a8406f7aef5703ee5259a52 (patch)
tree558d5915ddceab6bb47ed844dea9386c6036d087 /arch/x86/ia32/sys_ia32.c
parent11bd04f6f35621193311c32e0721142b073a7794 (diff)
parentaa65607373a4daf2010e8c3867b6317619f3c1a3 (diff)
downloadlinux-fsl-qoriq-aad3bf04dca5a2147a8406f7aef5703ee5259a52.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/viro/mmap
* git://git.kernel.org/pub/scm/linux/kernel/git/viro/mmap: Add missing alignment check in arch/score sys_mmap() fix broken aliasing checks for MAP_FIXED on sparc32, mips, arm and sh Get rid of open-coding in ia64_brk() sparc_brk() is not needed anymore switch do_brk() to get_unmapped_area() Take arch_mmap_check() into get_unmapped_area() fix a struct file leak in do_mmap_pgoff() Unify sys_mmap* Cut hugetlb case early for 32bit on ia64 arch_mmap_check() on mn10300 Kill ancient crap in s390 compat mmap arm: add arch_mmap_check(), get rid of sys_arm_mremap() file ->get_unmapped_area() shouldn't duplicate work of get_unmapped_area() kill useless checks in sparc mremap variants fix pgoff in "have to relocate" case of mremap() fix the arch checks in MREMAP_FIXED case fix checks for expand-in-place mremap do_mremap() untangling, part 3 do_mremap() untangling, part 2 untangling do_mremap(), part 1
Diffstat (limited to 'arch/x86/ia32/sys_ia32.c')
-rw-r--r--arch/x86/ia32/sys_ia32.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index df82c0e..422572c 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -155,9 +155,6 @@ struct mmap_arg_struct {
asmlinkage long sys32_mmap(struct mmap_arg_struct __user *arg)
{
struct mmap_arg_struct a;
- struct file *file = NULL;
- unsigned long retval;
- struct mm_struct *mm ;
if (copy_from_user(&a, arg, sizeof(a)))
return -EFAULT;
@@ -165,22 +162,8 @@ asmlinkage long sys32_mmap(struct mmap_arg_struct __user *arg)
if (a.offset & ~PAGE_MASK)
return -EINVAL;
- if (!(a.flags & MAP_ANONYMOUS)) {
- file = fget(a.fd);
- if (!file)
- return -EBADF;
- }
-
- mm = current->mm;
- down_write(&mm->mmap_sem);
- retval = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags,
+ return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
a.offset>>PAGE_SHIFT);
- if (file)
- fput(file);
-
- up_write(&mm->mmap_sem);
-
- return retval;
}
asmlinkage long sys32_mprotect(unsigned long start, size_t len,
@@ -483,30 +466,6 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd,
return ret;
}
-asmlinkage long sys32_mmap2(unsigned long addr, unsigned long len,
- unsigned long prot, unsigned long flags,
- unsigned long fd, unsigned long pgoff)
-{
- struct mm_struct *mm = current->mm;
- unsigned long error;
- struct file *file = NULL;
-
- flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
- if (!(flags & MAP_ANONYMOUS)) {
- file = fget(fd);
- if (!file)
- return -EBADF;
- }
-
- down_write(&mm->mmap_sem);
- error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
- up_write(&mm->mmap_sem);
-
- if (file)
- fput(file);
- return error;
-}
-
asmlinkage long sys32_olduname(struct oldold_utsname __user *name)
{
char *arch = "x86_64";