diff options
| -rw-r--r-- | arch/s390x/kernel/entry.S | 4 | ||||
| -rw-r--r-- | arch/s390x/kernel/linux32.c | 55 | ||||
| -rw-r--r-- | arch/s390x/kernel/linux32.h | 13 | ||||
| -rw-r--r-- | arch/s390x/kernel/wrapper32.S | 16 | ||||
| -rw-r--r-- | include/asm-s390x/compat.h | 13 |
5 files changed, 23 insertions, 78 deletions
diff --git a/arch/s390x/kernel/entry.S b/arch/s390x/kernel/entry.S index 66794e864c0d..03c188833122 100644 --- a/arch/s390x/kernel/entry.S +++ b/arch/s390x/kernel/entry.S @@ -490,8 +490,8 @@ sys_call_table: .long SYSCALL(sys_getpriority,sys32_getpriority_wrapper) .long SYSCALL(sys_setpriority,sys32_setpriority_wrapper) .long SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old profil syscall */ - .long SYSCALL(sys_statfs,sys32_statfs_wrapper) - .long SYSCALL(sys_fstatfs,sys32_fstatfs_wrapper) /* 100 */ + .long SYSCALL(sys_statfs,compat_sys_statfs_wrapper) + .long SYSCALL(sys_fstatfs,compat_sys_fstatfs_wrapper) /* 100 */ .long SYSCALL(sys_ni_syscall,sys_ni_syscall) .long SYSCALL(sys_socketcall,sys32_socketcall_wrapper) .long SYSCALL(sys_syslog,sys32_syslog_wrapper) diff --git a/arch/s390x/kernel/linux32.c b/arch/s390x/kernel/linux32.c index da4806a694bd..7a0c09af5d87 100644 --- a/arch/s390x/kernel/linux32.c +++ b/arch/s390x/kernel/linux32.c @@ -884,61 +884,6 @@ asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long a return sys32_fcntl(fd, cmd, arg); } -static inline int put_statfs (struct statfs32 *ubuf, struct statfs *kbuf) -{ - int err; - - err = put_user (kbuf->f_type, &ubuf->f_type); - err |= __put_user (kbuf->f_bsize, &ubuf->f_bsize); - err |= __put_user (kbuf->f_blocks, &ubuf->f_blocks); - err |= __put_user (kbuf->f_bfree, &ubuf->f_bfree); - err |= __put_user (kbuf->f_bavail, &ubuf->f_bavail); - err |= __put_user (kbuf->f_files, &ubuf->f_files); - err |= __put_user (kbuf->f_ffree, &ubuf->f_ffree); - err |= __put_user (kbuf->f_namelen, &ubuf->f_namelen); - err |= __put_user (kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]); - err |= __put_user (kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]); - return err; -} - -extern asmlinkage int sys_statfs(const char * path, struct statfs * buf); - -asmlinkage int sys32_statfs(const char * path, struct statfs32 *buf) -{ - int ret; - struct statfs s; - mm_segment_t old_fs = get_fs(); - char *pth; - - pth = getname (path); - ret = PTR_ERR(pth); - if (!IS_ERR(pth)) { - set_fs (KERNEL_DS); - ret = sys_statfs((const char *)pth, &s); - set_fs (old_fs); - putname (pth); - if (put_statfs(buf, &s)) - return -EFAULT; - } - return ret; -} - -extern asmlinkage int sys_fstatfs(unsigned int fd, struct statfs * buf); - -asmlinkage int sys32_fstatfs(unsigned int fd, struct statfs32 *buf) -{ - int ret; - struct statfs s; - mm_segment_t old_fs = get_fs(); - - set_fs (KERNEL_DS); - ret = sys_fstatfs(fd, &s); - set_fs (old_fs); - if (put_statfs(buf, &s)) - return -EFAULT; - return ret; -} - extern asmlinkage long sys_truncate(const char * path, unsigned long length); extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length); diff --git a/arch/s390x/kernel/linux32.h b/arch/s390x/kernel/linux32.h index 0c43c224c678..5d249c03cb75 100644 --- a/arch/s390x/kernel/linux32.h +++ b/arch/s390x/kernel/linux32.h @@ -25,19 +25,6 @@ struct ipc_kludge_32 { #define F_SETLK64 13 #define F_SETLKW64 14 -struct statfs32 { - __s32 f_type; - __s32 f_bsize; - __s32 f_blocks; - __s32 f_bfree; - __s32 f_bavail; - __s32 f_files; - __s32 f_ffree; - __kernel_fsid_t f_fsid; - __s32 f_namelen; - __s32 f_spare[6]; -}; - typedef __u32 old_sigset_t32; /* at least 32 bits */ struct old_sigaction32 { diff --git a/arch/s390x/kernel/wrapper32.S b/arch/s390x/kernel/wrapper32.S index 380d13fe4096..a50add0cf4f5 100644 --- a/arch/s390x/kernel/wrapper32.S +++ b/arch/s390x/kernel/wrapper32.S @@ -440,17 +440,17 @@ sys32_setpriority_wrapper: lgfr %r4,%r4 # int jg sys_setpriority # branch to system call - .globl sys32_statfs_wrapper -sys32_statfs_wrapper: + .globl compat_sys_statfs_wrapper +compat_sys_statfs_wrapper: llgtr %r2,%r2 # char * - llgtr %r3,%r3 # struct statfs_emu31 * - jg sys32_statfs # branch to system call + llgtr %r3,%r3 # struct compat_statfs * + jg compat_sys_statfs # branch to system call - .globl sys32_fstatfs_wrapper -sys32_fstatfs_wrapper: + .globl compat_sys_fstatfs_wrapper +compat_sys_fstatfs_wrapper: llgfr %r2,%r2 # unsigned int - llgtr %r3,%r3 # struct statfs_emu31 * - jg sys32_fstatfs # branch to system call + llgtr %r3,%r3 # struct compat_statfs * + jg compat_sys_fstatfs # branch to system call .globl sys32_socketcall_wrapper sys32_socketcall_wrapper: diff --git a/include/asm-s390x/compat.h b/include/asm-s390x/compat.h index d84bb8d4020d..1b2a43d03fe1 100644 --- a/include/asm-s390x/compat.h +++ b/include/asm-s390x/compat.h @@ -67,4 +67,17 @@ struct compat_flock { short __unused; }; +struct compat_statfs { + s32 f_type; + s32 f_bsize; + s32 f_blocks; + s32 f_bfree; + s32 f_bavail; + s32 f_files; + s32 f_ffree; + compat_fsid_t f_fsid; + s32 f_namelen; + s32 f_spare[6]; +}; + #endif /* _ASM_S390X_COMPAT_H */ |
