aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-01-21 15:25:54 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-03-03 22:58:33 -0500
commit2cf0966683430b6468f36ca20515a33ca7f2403c (patch)
tree902080486ebd7988d1250914c3809c4de472a22b /fs/open.c
parent22d1a35da0e247a006c286842a1846acb4ffed4f (diff)
make SYSCALL_DEFINE<n>-generated wrappers do asmlinkage_protect
... and switch i386 to HAVE_SYSCALL_WRAPPERS, killing open-coded uses of asmlinkage_protect() in a bunch of syscalls. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/fs/open.c b/fs/open.c
index a53922450448..8c741002f947 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -197,10 +197,7 @@ out:
197 197
198SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length) 198SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length)
199{ 199{
200 long ret = do_sys_ftruncate(fd, length, 1); 200 return do_sys_ftruncate(fd, length, 1);
201 /* avoid REGPARM breakage on x86: */
202 asmlinkage_protect(2, ret, fd, length);
203 return ret;
204} 201}
205 202
206#ifdef CONFIG_COMPAT 203#ifdef CONFIG_COMPAT
@@ -219,10 +216,7 @@ SYSCALL_DEFINE2(truncate64, const char __user *, path, loff_t, length)
219 216
220SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length) 217SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length)
221{ 218{
222 long ret = do_sys_ftruncate(fd, length, 0); 219 return do_sys_ftruncate(fd, length, 0);
223 /* avoid REGPARM breakage on x86: */
224 asmlinkage_protect(2, ret, fd, length);
225 return ret;
226} 220}
227#endif /* BITS_PER_LONG == 32 */ 221#endif /* BITS_PER_LONG == 32 */
228 222
@@ -961,29 +955,19 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
961 955
962SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) 956SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode)
963{ 957{
964 long ret;
965
966 if (force_o_largefile()) 958 if (force_o_largefile())
967 flags |= O_LARGEFILE; 959 flags |= O_LARGEFILE;
968 960
969 ret = do_sys_open(AT_FDCWD, filename, flags, mode); 961 return do_sys_open(AT_FDCWD, filename, flags, mode);
970 /* avoid REGPARM breakage on x86: */
971 asmlinkage_protect(3, ret, filename, flags, mode);
972 return ret;
973} 962}
974 963
975SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, 964SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
976 umode_t, mode) 965 umode_t, mode)
977{ 966{
978 long ret;
979
980 if (force_o_largefile()) 967 if (force_o_largefile())
981 flags |= O_LARGEFILE; 968 flags |= O_LARGEFILE;
982 969
983 ret = do_sys_open(dfd, filename, flags, mode); 970 return do_sys_open(dfd, filename, flags, mode);
984 /* avoid REGPARM breakage on x86: */
985 asmlinkage_protect(4, ret, dfd, filename, flags, mode);
986 return ret;
987} 971}
988 972
989#ifndef __alpha__ 973#ifndef __alpha__