aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-21 15:16:58 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-03-03 22:46:22 -0500
commit4a0fd5bf0fd0795af8f1be3b261f5cf146a4cb9b (patch)
tree8f8efa46a8e4e3fc1c3163f5021aff4f94aaa7fd /fs/open.c
parent07fe6e00f6cca6fef85a14a1dc3ed4f2e35d3f0b (diff)
teach SYSCALL_DEFINE<n> how to deal with long long/unsigned long long
... and convert a bunch of SYSCALL_DEFINE ones to SYSCALL_DEFINE<n>, killing the boilerplate crap around them. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/fs/open.c b/fs/open.c
index 68354466879f..a53922450448 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -212,32 +212,18 @@ COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_ulong_t, length)
212 212
213/* LFS versions of truncate are only needed on 32 bit machines */ 213/* LFS versions of truncate are only needed on 32 bit machines */
214#if BITS_PER_LONG == 32 214#if BITS_PER_LONG == 32
215SYSCALL_DEFINE(truncate64)(const char __user * path, loff_t length) 215SYSCALL_DEFINE2(truncate64, const char __user *, path, loff_t, length)
216{ 216{
217 return do_sys_truncate(path, length); 217 return do_sys_truncate(path, length);
218} 218}
219#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
220asmlinkage long SyS_truncate64(long path, loff_t length)
221{
222 return SYSC_truncate64((const char __user *) path, length);
223}
224SYSCALL_ALIAS(sys_truncate64, SyS_truncate64);
225#endif
226 219
227SYSCALL_DEFINE(ftruncate64)(unsigned int fd, loff_t length) 220SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length)
228{ 221{
229 long ret = do_sys_ftruncate(fd, length, 0); 222 long ret = do_sys_ftruncate(fd, length, 0);
230 /* avoid REGPARM breakage on x86: */ 223 /* avoid REGPARM breakage on x86: */
231 asmlinkage_protect(2, ret, fd, length); 224 asmlinkage_protect(2, ret, fd, length);
232 return ret; 225 return ret;
233} 226}
234#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
235asmlinkage long SyS_ftruncate64(long fd, loff_t length)
236{
237 return SYSC_ftruncate64((unsigned int) fd, length);
238}
239SYSCALL_ALIAS(sys_ftruncate64, SyS_ftruncate64);
240#endif
241#endif /* BITS_PER_LONG == 32 */ 227#endif /* BITS_PER_LONG == 32 */
242 228
243 229
@@ -299,7 +285,7 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
299 return ret; 285 return ret;
300} 286}
301 287
302SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len) 288SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
303{ 289{
304 struct fd f = fdget(fd); 290 struct fd f = fdget(fd);
305 int error = -EBADF; 291 int error = -EBADF;
@@ -311,14 +297,6 @@ SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len)
311 return error; 297 return error;
312} 298}
313 299
314#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
315asmlinkage long SyS_fallocate(long fd, long mode, loff_t offset, loff_t len)
316{
317 return SYSC_fallocate((int)fd, (int)mode, offset, len);
318}
319SYSCALL_ALIAS(sys_fallocate, SyS_fallocate);
320#endif
321
322/* 300/*
323 * access() needs to use the real uid/gid, not the effective uid/gid. 301 * access() needs to use the real uid/gid, not the effective uid/gid.
324 * We do this by temporarily clearing all FS-related capabilities and 302 * We do this by temporarily clearing all FS-related capabilities and