aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/s390/kernel/sys_s390.c14
-rw-r--r--fs/dcookies.c9
-rw-r--r--fs/notify/fanotify/fanotify_user.c17
-rw-r--r--fs/open.c28
-rw-r--r--fs/read_write.c24
-rw-r--r--fs/sync.c26
-rw-r--r--include/linux/syscalls.h5
-rw-r--r--mm/fadvise.c18
-rw-r--r--mm/readahead.c9
9 files changed, 23 insertions, 127 deletions
<
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index d0964d22adb5..23eb222c1658 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -132,19 +132,9 @@ SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args)
132 * to 132 * to
133 * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len 133 * %r2: fd, %r3: mode, %r4/%r5: offset, 96(%r15)-103(%r15): len
134 */ 134 */
135SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset, 135SYSCALL_DEFINE5(s390_fallocate, int, fd, int, mode, loff_t, offset,
136 u32 len_high, u32 len_low) 136 u32, len_high, u32, len_low)
137{ 137{
138 return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); 138 return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low);
139} 139}
140#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
141asmlinkage long SyS_s390_fallocate(long fd, long mode, loff_t offset,
142 long len_high, long len_low)
143{
144 return SYSC_s390_fallocate((int) fd, (int) mode, offset,
145 (u32) len_high, (u32) len_low);
146}
147SYSCALL_ALIAS(sys_s390_fallocate, SyS_s390_fallocate);
148#endif
149
150#endif 140#endif
diff --git a/fs/dcookies.c b/fs/dcookies.c
index 17c779967828..f08375b97ffb 100644
--- a/fs/dcookies.c
+++ b/fs/dcookies.c
@@ -145,7 +145,7 @@ out:
145/* And here is where the userspace process can look up the cookie value 145/* And here is where the userspace process can look up the cookie value
146 * to retrieve the path. 146 * to retrieve the path.
147 */ 147 */
148SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len) 148SYSCALL_DEFINE3(lookup_dcookie, u64, cookie64, char __user *, buf, size_t, len)
149{ 149{
150 unsigned long cookie = (unsigned long)cookie64; 150 unsigned long cookie = (unsigned long)cookie64;
151 int err = -EINVAL; 151 int err = -EINVAL;
@@ -201,13 +201,6 @@ out:
201 mutex_unlock(&dcookie_mutex); 201 mutex_unlock(&dcookie_mutex);
202 return err; 202 return err;
203} 203}
204#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
205asmlinkage long SyS_lookup_dcookie(u64 cookie64, long buf, long len)
206{
207 return SYSC_lookup_dcookie(cookie64, (char __user *) buf, (size_t) len);
208}
209SYSCALL_ALIAS(sys_lookup_dcookie, SyS_lookup_dcookie);
210#endif
211 204
212static int dcookie_init(void) 205static int dcookie_init(void)
213{ 206{
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 5d8444268a16..d0be29fa94cf 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -755,9 +755,9 @@ out_destroy_group:
755 return fd; 755 return fd;
756} 756}
757 757
758SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags, 758SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags,
759 __u64 mask, int dfd, 759 __u64, mask, int, dfd,
760 const char __user * pathname) 760 const char __user *, pathname)
761{ 761{
762 struct inode *inode = NULL; 762 struct inode *inode = NULL;
763 struct vfsmount *mnt = NULL; 763 struct vfsmount *mnt = NULL;
@@ -857,17 +857,6 @@ fput_and_out:
857 return ret; 857 return ret;
858} 858}
859 859
860#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
861asmlinkage long SyS_fanotify_mark(long fanotify_fd, long flags, __u64 mask,
862 long dfd, long pathname)
863{
864 return SYSC_fanotify_mark((int) fanotify_fd, (unsigned int) flags,
865 mask, (int) dfd,
866 (const char __user *) pathname);
867}
868SYSCALL_ALIAS(sys_fanotify_mark, SyS_fanotify_mark);
869#endif
870
871/* 860/*
872 * fanotify_user_setup - Our initialization function. Note that we cannot return 861 * fanotify_user_setup - Our initialization function. Note that we cannot return
873 * error because we have compiled-in VFS hooks. So an (unlikely) failure here 862 * error because we have compiled-in VFS hooks. So an (unlikely) failure here
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
diff --git a/fs/read_write.c b/fs/read_write.c
index a698eff457fb..dcfd58d95f44 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -487,8 +487,8 @@ SYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf,
487 return ret; 487 return ret;
488} 488}
489 489
490SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf, 490SYSCALL_DEFINE4(pread64, unsigned int, fd, char __user *, buf,
491 size_t count, loff_t pos) 491 size_t, count, loff_t, pos)
492{ 492{
493 struct fd f; 493 struct fd f;
494 ssize_t ret = -EBADF; 494 ssize_t ret = -EBADF;
@@ -506,17 +506,9 @@ SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf,
506 506
507 return ret; 507 return ret;
508} 508}
509#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
510asmlinkage long SyS_pread64(long fd, long buf, long count, loff_t pos)
511{
512 return SYSC_pread64((unsigned int) fd, (char __user *) buf,