[PATCH] s390: fstatat64 support
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Sun, 12 Feb 2006 11:35:03 +0000 (12:35 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 12 Feb 2006 18:11:58 +0000 (10:11 -0800)
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>
arch/s390/kernel/compat_linux.c
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/syscalls.S
include/asm-s390/unistd.h

index cc20f0e3a7d300f26cc1607a0a6b92c39d576fe1..2d021626c1a64f9ab55779b2cc004ab092508d78 100644 (file)
@@ -905,6 +905,26 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta
        return ret;
 }
 
+asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename,
+                             struct stat64_emu31 __user* statbuf, int flag)
+{
+       struct kstat stat;
+       int error = -EINVAL;
+
+       if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+               goto out;
+
+       if (flag & AT_SYMLINK_NOFOLLOW)
+               error = vfs_lstat_fd(dfd, filename, &stat);
+       else
+               error = vfs_stat_fd(dfd, filename, &stat);
+
+       if (!error)
+               error = cp_stat64(statbuf, &stat);
+out:
+       return error;
+}
+
 /*
  * Linux/i386 didn't use to be able to handle more than
  * 4 system call parameters, so these system calls used a memory
index 38a6ef5ec6249cfce1d186df601f1475ed919da8..dd2d6c3e8df86c2813580a9ccbf250bb78313246 100644 (file)
@@ -1523,13 +1523,13 @@ compat_sys_futimesat_wrapper:
        llgtr   %r4,%r4                 # struct timeval *
        jg      compat_sys_futimesat
 
-       .globl compat_sys_newfstatat_wrapper
-compat_sys_newfstatat_wrapper:
+       .globl sys32_fstatat_wrapper
+sys32_fstatat_wrapper:
        llgfr   %r2,%r2                 # unsigned int
        llgtr   %r3,%r3                 # char *
-       llgtr   %r4,%r4                 # struct stat *
+       llgtr   %r4,%r4                 # struct stat64 *
        lgfr    %r5,%r5                 # int
-       jg      compat_sys_newfstatat
+       jg      sys32_fstatat
 
        .globl sys_unlinkat_wrapper
 sys_unlinkat_wrapper:
index e86a4debb1600cafc5b095941822ee89d2dea7e0..84921fe8d2662dd01eb988a200a38bcaaa0935a1 100644 (file)
@@ -301,7 +301,7 @@ SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper)
 SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper)   /* 290 */
 SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper)
 SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper)
-SYSCALL(sys_newfstatat,sys_newfstatat,compat_sys_newfstatat_wrapper)
+SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat_wrapper)
 SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper)
 SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper)        /* 295 */
 SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper)
index 0a2f6664c4cf4d58c42e77a2df7b3df66ed6ae5f..657d582e8149504e331e65dc7e30cf85aceb7117 100644 (file)
 #define __NR_mknodat           290
 #define __NR_fchownat          291
 #define __NR_futimesat         292
-#define __NR_newfstatat                293
+#define __NR_fstatat64         293
 #define __NR_unlinkat          294
 #define __NR_renameat          295
 #define __NR_linkat            296
 #undef  __NR_fcntl64
 #undef  __NR_sendfile64
 #undef  __NR_fadvise64_64
+#undef  __NR_fstatat64
 
 #define __NR_select            142
 #define __NR_getrlimit         191     /* SuS compliant getrlimit */
 #define __NR_setgid            214
 #define __NR_setfsuid                  215
 #define __NR_setfsgid                  216
+#define __NR_newfstatat                293
 
 #endif