aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2006-02-12 06:35:03 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-12 13:11:58 -0500
commit19bf9cbf6b313ae79a0c7278ccaa9c72c86931bd (patch)
tree957055cc4aec4db615cfd9726777b0815ca405ac
parentbc6d7fdf460ec5292d66bb551dbfa49ca682bebf (diff)
[PATCH] s390: fstatat64 support
Add fstatat64 support to s390 in order to follow changes with commit cff2b760096d1e6feaa31948e7af4abbefe47822 . Also fixes compilation for 31 bit. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/s390/kernel/compat_linux.c20
-rw-r--r--arch/s390/kernel/compat_wrapper.S8
-rw-r--r--arch/s390/kernel/syscalls.S2
-rw-r--r--include/asm-s390/unistd.h4
4 files changed, 28 insertions, 6 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index cc20f0e3a7d3..2d021626c1a6 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -905,6 +905,26 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta
905 return ret; 905 return ret;
906} 906}
907 907
908asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename,
909 struct stat64_emu31 __user* statbuf, int flag)
910{
911 struct kstat stat;
912 int error = -EINVAL;
913
914 if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
915 goto out;
916
917 if (flag & AT_SYMLINK_NOFOLLOW)
918 error = vfs_lstat_fd(dfd, filename, &stat);
919 else
920 error = vfs_stat_fd(dfd, filename, &stat);
921
922 if (!error)
923 error = cp_stat64(statbuf, &stat);
924out:
925 return error;
926}
927
908/* 928/*
909 * Linux/i386 didn't use to be able to handle more than 929 * Linux/i386 didn't use to be able to handle more than
910 * 4 system call parameters, so these system calls used a memory 930 * 4 system call parameters, so these system calls used a memory
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 38a6ef5ec624..dd2d6c3e8df8 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -1523,13 +1523,13 @@ compat_sys_futimesat_wrapper:
1523 llgtr %r4,%r4 # struct timeval * 1523 llgtr %r4,%r4 # struct timeval *
1524 jg compat_sys_futimesat 1524 jg compat_sys_futimesat
1525 1525
1526 .globl compat_sys_newfstatat_wrapper 1526 .globl sys32_fstatat_wrapper
1527compat_sys_newfstatat_wrapper: 1527sys32_fstatat_wrapper:
1528 llgfr %r2,%r2 # unsigned int 1528 llgfr %r2,%r2 # unsigned int
1529 llgtr %r3,%r3 # char * 1529 llgtr %r3,%r3 # char *
1530 llgtr %r4,%r4 # struct stat * 1530 llgtr %r4,%r4 # struct stat64 *
1531 lgfr %r5,%r5 # int 1531 lgfr %r5,%r5 # int
1532 jg compat_sys_newfstatat 1532 jg sys32_fstatat
1533 1533
1534 .globl sys_unlinkat_wrapper 1534 .globl sys_unlinkat_wrapper
1535sys_unlinkat_wrapper: 1535sys_unlinkat_wrapper:
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index e86a4debb160..84921fe8d266 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -301,7 +301,7 @@ SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper)
301SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */ 301SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */
302SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper) 302SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper)
303SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper) 303SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper)
304SYSCALL(sys_newfstatat,sys_newfstatat,compat_sys_newfstatat_wrapper) 304SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat_wrapper)
305SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper) 305SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper)
306SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */ 306SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */
307SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper) 307SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper)
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 0a2f6664c4cf..657d582e8149 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -285,7 +285,7 @@
285#define __NR_mknodat 290 285#define __NR_mknodat 290
286#define __NR_fchownat 291 286#define __NR_fchownat 291
287#define __NR_futimesat 292 287#define __NR_futimesat 292
288#define __NR_newfstatat 293 288#define __NR_fstatat64 293
289#define __NR_unlinkat 294 289#define __NR_unlinkat 294
290#define __NR_renameat 295 290#define __NR_renameat 295
291#define __NR_linkat 296 291#define __NR_linkat 296
@@ -359,6 +359,7 @@
359#undef __NR_fcntl64 359#undef __NR_fcntl64
360#undef __NR_sendfile64 360#undef __NR_sendfile64
361#undef __NR_fadvise64_64 361#undef __NR_fadvise64_64
362#undef __NR_fstatat64
362 363
363#define __NR_select 142 364#define __NR_select 142
364#define __NR_getrlimit 191 /* SuS compliant getrlimit */ 365#define __NR_getrlimit 191 /* SuS compliant getrlimit */
@@ -381,6 +382,7 @@
381#define __NR_setgid 214 382#define __NR_setgid 214
382#define __NR_setfsuid 215 383#define __NR_setfsuid 215
383#define __NR_setfsgid 216 384#define __NR_setfsgid 216
385#define __NR_newfstatat 293
384 386
385#endif 387#endif
386 388