Commit 384ceab5 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Christoph Hellwig

[PATCH] compat_sys_fcntl{,64} parisc part

Here is the parisc part of the patch with Willy's blessing.
parent d808f621
......@@ -316,35 +316,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
return -ENOSYS;
}
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)
{
switch (cmd) {
case F_GETLK:
case F_SETLK:
case F_SETLKW:
{
struct flock f;
long ret;
if (get_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
KERNEL_SYSCALL(ret, sys_fcntl, fd, cmd, (unsigned long)&f);
if (ret) return ret;
if (f.l_start >= 0x7fffffffUL ||
f.l_len >= 0x7fffffffUL ||
f.l_start + f.l_len >= 0x7fffffffUL)
return -EOVERFLOW;
if (put_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
return 0;
}
default:
return sys_fcntl(fd, cmd, (unsigned long)arg);
}
}
#ifdef CONFIG_SYSCTL
struct __sysctl_args32 {
......@@ -1300,28 +1271,6 @@ asmlinkage long sys32_msgrcv(int msqid,
return err;
}
/* LFS */
extern asmlinkage long sys_fcntl(unsigned int, unsigned int, unsigned long);
asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
{
switch (cmd) {
case F_GETLK64:
cmd = F_GETLK;
break;
case F_SETLK64:
cmd = F_SETLK;
break;
case F_SETLKW64:
cmd = F_SETLKW;
break;
default:
break;
}
return sys32_fcntl(fd, cmd, arg);
}
/* EXPORT/UNEXPORT */
struct nfsctl_export32 {
char ex_client[NFSCLNT_IDMAX+1];
......
......@@ -409,8 +409,7 @@ sys_call_table:
ENTRY_SAME(getpeername)
/* This one's a huge ugly mess */
ENTRY_DIFF(ioctl)
/* struct flock? */
ENTRY_DIFF(fcntl) /* 55 */
ENTRY_COMP(fcntl) /* 55 */
ENTRY_SAME(socketpair)
ENTRY_SAME(setpgid)
ENTRY_SAME(send)
......@@ -589,7 +588,7 @@ sys_call_table:
ENTRY_OURS(truncate64)
ENTRY_OURS(ftruncate64) /* 200 */
ENTRY_SAME(getdents64)
ENTRY_DIFF(fcntl64)
ENTRY_COMP(fcntl64)
ENTRY_SAME(ni_syscall)
ENTRY_SAME(ni_syscall)
ENTRY_SAME(ni_syscall) /* 205 */
......
......@@ -72,6 +72,14 @@ struct compat_flock {
compat_pid_t l_pid;
};
struct compat_flock64 {
short l_type;
short l_whence;
compat_loff_t l_start;
compat_loff_t l_len;
compat_pid_t l_pid;
};
struct compat_statfs {
s32 f_type;
s32 f_bsize;
......@@ -92,4 +100,7 @@ typedef u32 compat_old_sigset_t; /* at least 32 bits */
typedef u32 compat_sigset_word;
#define COMPAT_OFF_T_MAX 0x7fffffff
#define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL
#endif /* _ASM_PARISC_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