Commit 0c1821db authored by Stephen Rothwell's avatar Stephen Rothwell Committed by David S. Miller

[PATCH] compat_flock: x86_64

parent c8e9f940
......@@ -1066,30 +1066,6 @@ sys32_getrusage(int who, struct rusage32 *ru)
return ret;
}
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);
asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg);
......@@ -1105,13 +1081,13 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
mm_segment_t old_fs;
long ret;
if (get_flock(&f, (struct flock32 *)arg))
if (get_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f);
set_fs (old_fs);
if (ret) return ret;
if (put_flock(&f, (struct flock32 *)arg))
if (put_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
return 0;
}
......
......@@ -54,4 +54,12 @@ struct compat_stat {
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;
};
#endif /* _ASM_X86_64_COMPAT_H */
......@@ -22,16 +22,6 @@ typedef long __kernel_loff_t32;
typedef __kernel_fsid_t __kernel_fsid_t32;
/* fcntl.h */
struct flock32 {
short l_type;
short l_whence;
compat_off_t l_start;
compat_off_t l_len;
compat_pid_t l_pid;
};
struct ia32_flock64 {
short l_type;
short l_whence;
......
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