Commit 692e5796 authored by David S. Miller's avatar David S. Miller

[SPARC64]: flock compat changes

parent 54303f1e
......@@ -804,30 +804,6 @@ asmlinkage int sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u
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);
asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
......@@ -841,13 +817,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;
}
......
......@@ -42,4 +42,13 @@ struct compat_timeval {
s32 tv_usec;
};
struct compat_flock {
short l_type;
short l_whence;
__kernel_off_t32 l_start;
__kernel_off_t32 l_len;
__kernel_pid_t32 l_pid;
short __unused;
};
#endif /* _ASM_SPARC64_COMPAT_H */
......@@ -78,17 +78,6 @@ struct flock {
short __unused;
};
#ifdef __KERNEL__
struct flock32 {
short l_type;
short l_whence;
__kernel_off_t32 l_start;
__kernel_off_t32 l_len;
__kernel_pid_t32 l_pid;
short __unused;
};
#endif
#ifdef __KERNEL__
#define flock64 flock
#endif
......
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