Commit 2622cf1d authored by Stephen Rothwell's avatar Stephen Rothwell Committed by David S. Miller

[PATCH] compat_flock: s390x

parent db3da180
...@@ -833,30 +833,6 @@ asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u ...@@ -833,30 +833,6 @@ asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u
return err; return err;
} }
static inline int get_flock(struct flock *kfl, struct flock32 *ufl)
{
int err;
err = get_user(kfl->l_type, &ufl->l_type);
err |= __get_user(kfl->l_whence, &ufl->l_whence);
err |= __get_user(kfl->l_start, &ufl->l_start);
err |= __get_user(kfl->l_len, &ufl->l_len);
err |= __get_user(kfl->l_pid, &ufl->l_pid);
return err;
}
static inline int put_flock(struct flock *kfl, struct flock32 *ufl)
{
int err;
err = __put_user(kfl->l_type, &ufl->l_type);
err |= __put_user(kfl->l_whence, &ufl->l_whence);
err |= __put_user(kfl->l_start, &ufl->l_start);
err |= __put_user(kfl->l_len, &ufl->l_len);
err |= __put_user(kfl->l_pid, &ufl->l_pid);
return err;
}
extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
...@@ -868,7 +844,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg ...@@ -868,7 +844,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
mm_segment_t old_fs; mm_segment_t old_fs;
long ret; long ret;
if(get_flock(&f, (struct flock32 *)A(arg))) if(get_compat_flock(&f, (struct compat_flock *)A(arg)))
return -EFAULT; return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS); old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f); ret = sys_fcntl(fd, cmd, (unsigned long)&f);
...@@ -877,7 +853,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg ...@@ -877,7 +853,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
if (f.l_start >= 0x7fffffffUL || if (f.l_start >= 0x7fffffffUL ||
f.l_start + f.l_len >= 0x7fffffffUL) f.l_start + f.l_len >= 0x7fffffffUL)
return -EOVERFLOW; return -EOVERFLOW;
if(put_flock(&f, (struct flock32 *)A(arg))) if(put_compat_flock(&f, (struct compat_flock *)A(arg)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -888,7 +864,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg ...@@ -888,7 +864,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
mm_segment_t old_fs; mm_segment_t old_fs;
long ret; long ret;
if(get_flock(&f, (struct flock32 *)A(arg))) if(get_compat_flock(&f, (struct compat_flock *)A(arg)))
return -EFAULT; return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS); old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f); ret = sys_fcntl(fd, cmd, (unsigned long)&f);
......
...@@ -25,15 +25,6 @@ struct ipc_kludge_32 { ...@@ -25,15 +25,6 @@ struct ipc_kludge_32 {
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #define F_SETLKW64 14
struct flock32 {
short l_type;
short l_whence;
compat_off_t l_start;
compat_off_t l_len;
compat_pid_t l_pid;
short __unused;
};
struct statfs32 { struct statfs32 {
__s32 f_type; __s32 f_type;
__s32 f_bsize; __s32 f_bsize;
......
...@@ -58,4 +58,13 @@ struct compat_stat { ...@@ -58,4 +58,13 @@ struct compat_stat {
u32 __unused5; u32 __unused5;
}; };
struct compat_flock {
short l_type;
short l_whence;
compat_off_t l_start;
compat_off_t l_len;
compat_pid_t l_pid;
short __unused;
};
#endif /* _ASM_S390X_COMPAT_H */ #endif /* _ASM_S390X_COMPAT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment