diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-11-30 17:37:04 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 06:44:29 -0500 |
commit | f8b7256096a20436f6d0926747e3ac3d64c81d24 (patch) | |
tree | 18bcabd1de263bd2d0f8d6b763bde8b037716c5c /arch/mn10300 | |
parent | 0067bd8a55862ac9dd212bd1c4f6f5bff1ca1301 (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/mn10300')
-rw-r--r-- | arch/mn10300/kernel/entry.S | 2 | ||||
-rw-r--r-- | arch/mn10300/kernel/sys_mn10300.c | 31 |
2 files changed, 2 insertions, 31 deletions
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S index a94e7ea3faa6..c9ee6c009d79 100644 --- a/arch/mn10300/kernel/entry.S +++ b/arch/mn10300/kernel/entry.S | |||
@@ -578,7 +578,7 @@ ENTRY(sys_call_table) | |||
578 | .long sys_ni_syscall /* reserved for streams2 */ | 578 | .long sys_ni_syscall /* reserved for streams2 */ |
579 | .long sys_vfork /* 190 */ | 579 | .long sys_vfork /* 190 */ |
580 | .long sys_getrlimit | 580 | .long sys_getrlimit |
581 | .long sys_mmap2 | 581 | .long sys_mmap_pgoff |
582 | .long sys_truncate64 | 582 | .long sys_truncate64 |
583 | .long sys_ftruncate64 | 583 | .long sys_ftruncate64 |
584 | .long sys_stat64 /* 195 */ | 584 | .long sys_stat64 /* 195 */ |
diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c index ec4100dfcb7d..17cc6ce04e84 100644 --- a/arch/mn10300/kernel/sys_mn10300.c +++ b/arch/mn10300/kernel/sys_mn10300.c | |||
@@ -23,42 +23,13 @@ | |||
23 | 23 | ||
24 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
25 | 25 | ||
26 | /* | ||
27 | * memory mapping syscall | ||
28 | */ | ||
29 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
30 | unsigned long prot, unsigned long flags, | ||
31 | unsigned long fd, unsigned long pgoff) | ||
32 | { | ||
33 | struct file *file = NULL; | ||
34 | long error = -EINVAL; | ||
35 | |||
36 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
37 | |||
38 | error = -EBADF; | ||
39 | if (!(flags & MAP_ANONYMOUS)) { | ||
40 | file = fget(fd); | ||
41 | if (!file) | ||
42 | goto out; | ||
43 | } | ||
44 | |||
45 | down_write(¤t->mm->mmap_sem); | ||
46 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
47 | up_write(¤t->mm->mmap_sem); | ||
48 | |||
49 | if (file) | ||
50 | fput(file); | ||
51 | out: | ||
52 | return error; | ||
53 | } | ||
54 | |||
55 | asmlinkage long old_mmap(unsigned long addr, unsigned long len, | 26 | asmlinkage long old_mmap(unsigned long addr, unsigned long len, |
56 | unsigned long prot, unsigned long flags, | 27 | unsigned long prot, unsigned long flags, |
57 | unsigned long fd, unsigned long offset) | 28 | unsigned long fd, unsigned long offset) |
58 | { | 29 | { |
59 | if (offset & ~PAGE_MASK) | 30 | if (offset & ~PAGE_MASK) |
60 | return -EINVAL; | 31 | return -EINVAL; |
61 | return sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); | 32 | return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); |
62 | } | 33 | } |
63 | 34 | ||
64 | struct sel_arg_struct { | 35 | struct sel_arg_struct { |