aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
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/alpha
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/alpha')
-rw-r--r--arch/alpha/kernel/osf_sys.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 9a3334ae282e..62619f25132f 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -178,25 +178,18 @@ SYSCALL_DEFINE6(osf_mmap, unsigned long, addr, unsigned long, len,
178 unsigned long, prot, unsigned long, flags, unsigned long, fd, 178 unsigned long, prot, unsigned long, flags, unsigned long, fd,
179 unsigned long, off) 179 unsigned long, off)
180{ 180{
181 struct file *file = NULL; 181 unsigned long ret = -EINVAL;
182 unsigned long ret = -EBADF;
183 182
184#if 0 183#if 0
185 if (flags & (_MAP_HASSEMAPHORE | _MAP_INHERIT | _MAP_UNALIGNED)) 184 if (flags & (_MAP_HASSEMAPHORE | _MAP_INHERIT | _MAP_UNALIGNED))
186 printk("%s: unimplemented OSF mmap flags %04lx\n", 185 printk("%s: unimplemented OSF mmap flags %04lx\n",
187 current->comm, flags); 186 current->comm, flags);
188#endif 187#endif
189 if (!(flags & MAP_ANONYMOUS)) { 188 if ((off + PAGE_ALIGN(len)) < off)
190 file = fget(fd); 189 goto out;
191 if (!file) 190 if (off & ~PAGE_MASK)
192 goto out; 191 goto out;
193 } 192 ret = sys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
194 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
195 down_write(&current->mm->mmap_sem);
196 ret = do_mmap(file, addr, len, prot, flags, off);
197 up_write(&current->mm->mmap_sem);
198 if (file)
199 fput(file);
200 out: 193 out:
201 return ret; 194 return ret;
202} 195}