From 384ceab5570104b73aad517ac5d5a2b082174658 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 10 Mar 2003 17:34:25 -0800 Subject: [PATCH] [PATCH] compat_sys_fcntl{,64} parisc part Here is the parisc part of the patch with Willy's blessing. --- arch/parisc/kernel/sys_parisc32.c | 51 ------------------------------- arch/parisc/kernel/syscall.S | 5 ++- include/asm-parisc/compat.h | 11 +++++++ 3 files changed, 13 insertions(+), 54 deletions(-) diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index e2de665866e91..0569f318b523c 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c @@ -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]; diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 1f8ecc14ac365..2e313c8984691 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -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 */ diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h index 4cbe08f1b22ef..a95e682ea0bde 100644 --- a/include/asm-parisc/compat.h +++ b/include/asm-parisc/compat.h @@ -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 */ -- 2.53.0