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

[PATCH] compat_flock: ppc64

parent 8baa2cda
...@@ -247,30 +247,6 @@ asmlinkage long sys32_writev(int fd, struct iovec32 *vector, u32 count) ...@@ -247,30 +247,6 @@ asmlinkage long sys32_writev(int fd, struct iovec32 *vector, u32 count)
return ret; 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); 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)
{ {
...@@ -283,12 +259,12 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg ...@@ -283,12 +259,12 @@ 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 *)arg)) if(get_compat_flock(&f, (struct compat_flock *)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);
set_fs (old_fs); set_fs (old_fs);
if(put_flock(&f, (struct flock32 *)arg)) if(put_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT; return -EFAULT;
return ret; return ret;
} }
......
...@@ -55,4 +55,13 @@ struct compat_stat { ...@@ -55,4 +55,13 @@ struct compat_stat {
u32 __unused4[2]; u32 __unused4[2];
}; };
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_PPC64_COMPAT_H */ #endif /* _ASM_PPC64_COMPAT_H */
...@@ -141,15 +141,6 @@ typedef struct sigaltstack_32 { ...@@ -141,15 +141,6 @@ typedef struct sigaltstack_32 {
compat_size_t ss_size; compat_size_t ss_size;
} stack_32_t; } stack_32_t;
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 sigcontext32 { struct sigcontext32 {
unsigned int _unused[4]; unsigned int _unused[4];
int signal; int signal;
......
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