diff options
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 52 |
1 files changed, 7 insertions, 45 deletions
@@ -197,10 +197,7 @@ out: | |||
197 | 197 | ||
198 | SYSCALL_DEFINE2(ftruncate, unsigned int, fd, unsigned long, length) | 198 | SYSCALL_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 |
@@ -212,32 +209,15 @@ COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_ulong_t, length) | |||
212 | 209 | ||
213 | /* LFS versions of truncate are only needed on 32 bit machines */ | 210 | /* LFS versions of truncate are only needed on 32 bit machines */ |
214 | #if BITS_PER_LONG == 32 | 211 | #if BITS_PER_LONG == 32 |
215 | SYSCALL_DEFINE(truncate64)(const char __user * path, loff_t length) | 212 | SYSCALL_DEFINE2(truncate64, const char __user *, path, loff_t, length) |
216 | { | 213 | { |
217 | return do_sys_truncate(path, length); | 214 | return do_sys_truncate(path, length); |
218 | } | 215 | } |
219 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
220 | asmlinkage long SyS_truncate64(long path, loff_t length) | ||
221 | { | ||
222 | return SYSC_truncate64((const char __user *) path, length); | ||
223 | } | ||
224 | SYSCALL_ALIAS(sys_truncate64, SyS_truncate64); | ||
225 | #endif | ||
226 | 216 | ||
227 | SYSCALL_DEFINE(ftruncate64)(unsigned int fd, loff_t length) | 217 | SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length) |
228 | { | 218 | { |
229 | long ret = do_sys_ftruncate(fd, length, 0); | 219 | return do_sys_ftruncate(fd, length, 0); |
230 | /* avoid REGPARM breakage on x86: */ | ||
231 | asmlinkage_protect(2, ret, fd, length); | ||
232 | return ret; | ||
233 | } | ||
234 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
235 | asmlinkage long SyS_ftruncate64(long fd, loff_t length) | ||
236 | { | ||
237 | return SYSC_ftruncate64((unsigned int) fd, length); | ||
238 | } | 220 | } |
239 | SYSCALL_ALIAS(sys_ftruncate64, SyS_ftruncate64); | ||
240 | #endif | ||
241 | #endif /* BITS_PER_LONG == 32 */ | 221 | #endif /* BITS_PER_LONG == 32 */ |
242 | 222 | ||
243 | 223 | ||
@@ -299,7 +279,7 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) | |||
299 | return ret; | 279 | return ret; |
300 | } | 280 | } |
301 | 281 | ||
302 | SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len) | 282 | SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len) |
303 | { | 283 | { |
304 | struct fd f = fdget(fd); | 284 | struct fd f = fdget(fd); |
305 | int error = -EBADF; | 285 | int error = -EBADF; |
@@ -311,14 +291,6 @@ SYSCALL_DEFINE(fallocate)(int fd, int mode, loff_t offset, loff_t len) | |||
311 | return error; | 291 | return error; |
312 | } | 292 | } |
313 | 293 | ||
314 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | ||
315 | asmlinkage 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 | } | ||
319 | SYSCALL_ALIAS(sys_fallocate, SyS_fallocate); | ||
320 | #endif | ||
321 | |||
322 | /* | 294 | /* |
323 | * access() needs to use the real uid/gid, not the effective uid/gid. | 295 | * 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 | 296 | * We do this by temporarily clearing all FS-related capabilities and |
@@ -983,29 +955,19 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode) | |||
983 | 955 | ||
984 | SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) | 956 | SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) |
985 | { | 957 | { |
986 | long ret; | ||
987 | |||
988 | if (force_o_largefile()) | 958 | if (force_o_largefile()) |
989 | flags |= O_LARGEFILE; | 959 | flags |= O_LARGEFILE; |
990 | 960 | ||
991 | ret = do_sys_open(AT_FDCWD, filename, flags, mode); | 961 | return do_sys_open(AT_FDCWD, filename, flags, mode); |
992 | /* avoid REGPARM breakage on x86: */ | ||
993 | asmlinkage_protect(3, ret, filename, flags, mode); | ||
994 | return ret; | ||
995 | } | 962 | } |
996 | 963 | ||
997 | SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, | 964 | SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, |
998 | umode_t, mode) | 965 | umode_t, mode) |
999 | { | 966 | { |
1000 | long ret; | ||
1001 | |||
1002 | if (force_o_largefile()) | 967 | if (force_o_largefile()) |
1003 | flags |= O_LARGEFILE; | 968 | flags |= O_LARGEFILE; |
1004 | 969 | ||
1005 | ret = do_sys_open(dfd, filename, flags, mode); | 970 | return do_sys_open(dfd, filename, flags, mode); |
1006 | /* avoid REGPARM breakage on x86: */ | ||
1007 | asmlinkage_protect(4, ret, dfd, filename, flags, mode); | ||
1008 | return ret; | ||
1009 | } | 971 | } |
1010 | 972 | ||
1011 | #ifndef __alpha__ | 973 | #ifndef __alpha__ |