linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part
@ 2003-03-04  5:58 Stephen Rothwell
  2003-03-04  6:00 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 PPC64 part Stephen Rothwell
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  5:58 UTC (permalink / raw)
  To: Linus
  Cc: LKML, anton, David S. Miller, ak, davidm, schwidefsky, ralf, matthew

Hi Linus,

This patch creates compat_sys_fcntl{,64}.  The diffstat for the whole
patch set is below, but this is just the generic part, the architecture
specific parts will follow.

This patch also removes struct flock64 from all the 64 bit architectures
(except parisc).

I think I have answered all the questions from the last time I posted
this, so please apply.

 arch/ia64/ia32/ia32_entry.S       |    4 -
 arch/ia64/ia32/sys_ia32.c         |   92 -----------------------
 arch/mips64/kernel/linux32.c      |   44 -----------
 arch/mips64/kernel/scall_o32.S    |    4 -
 arch/parisc/kernel/sys_parisc32.c |   51 -------------
 arch/parisc/kernel/syscall.S      |    5 -
 arch/ppc64/kernel/misc.S          |    4 -
 arch/ppc64/kernel/sys_ppc32.c     |   33 --------
 arch/s390x/kernel/entry.S         |    4 -
 arch/s390x/kernel/linux32.c       |   51 -------------
 arch/s390x/kernel/linux32.h       |    4 -
 arch/s390x/kernel/wrapper32.S     |   12 +--
 arch/sparc64/kernel/sys_sparc32.c |   35 ---------
 arch/sparc64/kernel/systbls.S     |    6 -
 arch/x86_64/ia32/ia32entry.S      |    4 -
 arch/x86_64/ia32/sys_ia32.c       |   96 ------------------------
 fs/compat.c                       |  147 ++++++++++++++++++++++++++++++--------
 include/asm-alpha/fcntl.h         |    3
 include/asm-ia64/compat.h         |   19 ++++
 include/asm-ia64/fcntl.h          |    5 -
 include/asm-ia64/ia32.h           |    4 -
 include/asm-mips64/compat.h       |   18 ++++
 include/asm-mips64/fcntl.h        |   10 --
 include/asm-parisc/compat.h       |   11 ++
 include/asm-ppc64/compat.h        |   16 +++-
 include/asm-ppc64/fcntl.h         |   13 ---
 include/asm-s390x/compat.h        |   16 +++-
 include/asm-s390x/fcntl.h         |    2
 include/asm-sparc64/compat.h      |   16 ++++
 include/asm-sparc64/fcntl.h       |   11 --
 include/asm-x86_64/compat.h       |   18 ++++
 include/asm-x86_64/fcntl.h        |    4 -
 include/asm-x86_64/ia32.h         |   12 ---
 include/linux/compat.h            |    3
 include/linux/fs.h                |    2
 35 files changed, 254 insertions(+), 525 deletions(-)


-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/fs/compat.c 2.5.63-32bit.2/fs/compat.c
--- 2.5.63-32bit.1/fs/compat.c	2003-01-14 09:57:57.000000000 +1100
+++ 2.5.63-32bit.2/fs/compat.c	2003-02-25 14:35:59.000000000 +1100
@@ -75,36 +75,6 @@
 	return error;
 }
 
-int get_compat_flock(struct flock *kfl, struct compat_flock *ufl)
-{
-	int err;
-
-	if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)))
-		return -EFAULT;
-
-	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;
-}
-
-int put_compat_flock(struct flock *kfl, struct compat_flock *ufl)
-{
-	int err;
-
-	if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)))
-		return -EFAULT;
-
-	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;
-}
-
 static int put_compat_statfs(struct compat_statfs *ubuf, struct statfs *kbuf)
 {
 	if (verify_area(VERIFY_WRITE, ubuf, sizeof(*ubuf)) ||
@@ -159,3 +129,120 @@
 out:
 	return error;
 }
+
+static int get_compat_flock(struct flock *kfl, struct compat_flock *ufl)
+{
+	if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)) ||
+	    __get_user(kfl->l_type, &ufl->l_type) ||
+	    __get_user(kfl->l_whence, &ufl->l_whence) ||
+	    __get_user(kfl->l_start, &ufl->l_start) ||
+	    __get_user(kfl->l_len, &ufl->l_len) ||
+	    __get_user(kfl->l_pid, &ufl->l_pid))
+		return -EFAULT;
+	return 0;
+}
+
+static int put_compat_flock(struct flock *kfl, struct compat_flock *ufl)
+{
+	if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)) ||
+	    __put_user(kfl->l_type, &ufl->l_type) ||
+	    __put_user(kfl->l_whence, &ufl->l_whence) ||
+	    __put_user(kfl->l_start, &ufl->l_start) ||
+	    __put_user(kfl->l_len, &ufl->l_len) ||
+	    __put_user(kfl->l_pid, &ufl->l_pid))
+		return -EFAULT;
+	return 0;
+}
+
+static int get_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
+{
+	if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)) ||
+	    __get_user(kfl->l_type, &ufl->l_type) ||
+	    __get_user(kfl->l_whence, &ufl->l_whence) ||
+	    __get_user(kfl->l_start, &ufl->l_start) ||
+	    __get_user(kfl->l_len, &ufl->l_len) ||
+	    __get_user(kfl->l_pid, &ufl->l_pid))
+		return -EFAULT;
+	return 0;
+}
+
+static int put_compat_flock64(struct flock *kfl, struct compat_flock64 *ufl)
+{
+	if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)) ||
+	    __put_user(kfl->l_type, &ufl->l_type) ||
+	    __put_user(kfl->l_whence, &ufl->l_whence) ||
+	    __put_user(kfl->l_start, &ufl->l_start) ||
+	    __put_user(kfl->l_len, &ufl->l_len) ||
+	    __put_user(kfl->l_pid, &ufl->l_pid))
+		return -EFAULT;
+	return 0;
+}
+
+extern asmlinkage long sys_fcntl(unsigned int, unsigned int, unsigned long);
+
+asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
+		unsigned long arg)
+{
+	mm_segment_t old_fs;
+	struct flock f;
+	long ret;
+
+	switch (cmd) {
+	case F_GETLK:
+	case F_SETLK:
+	case F_SETLKW:
+		ret = get_compat_flock(&f, (struct compat_flock *)arg);
+		if (ret != 0)
+			break;
+		old_fs = get_fs();
+		set_fs(KERNEL_DS);
+		ret = sys_fcntl(fd, cmd, (unsigned long)&f);
+		set_fs(old_fs);
+		if ((cmd == F_GETLK) && (ret == 0)) {
+			if ((f.l_start >= COMPAT_OFF_T_MAX) ||
+			    ((f.l_start + f.l_len) >= COMPAT_OFF_T_MAX))
+				ret = -EOVERFLOW;
+			if (ret == 0)
+				ret = put_compat_flock(&f,
+						(struct compat_flock *)arg);
+		}
+		break;
+
+	case F_GETLK64:
+	case F_SETLK64:
+	case F_SETLKW64:
+		ret = get_compat_flock64(&f, (struct compat_flock64 *)arg);
+		if (ret != 0)
+			break;
+		old_fs = get_fs();
+		set_fs(KERNEL_DS);
+		ret = sys_fcntl(fd, F_GETLK, (unsigned long)&f);
+		ret = sys_fcntl(fd, (cmd == F_GETLK64) ? F_GETLK :
+				((cmd == F_SETLK64) ? F_SETLK : F_SETLKW),
+				(unsigned long)&f);
+		set_fs(old_fs);
+		if ((cmd == F_GETLK64) && (ret == 0)) {
+			if ((f.l_start >= COMPAT_LOFF_T_MAX) ||
+			    ((f.l_start + f.l_len) >= COMPAT_LOFF_T_MAX))
+				ret = -EOVERFLOW;
+			if (ret == 0)
+				ret = put_compat_flock64(&f,
+						(struct compat_flock64 *)arg);
+		}
+		break;
+
+	default:
+		ret = sys_fcntl(fd, cmd, arg);
+		break;
+	}
+	return ret;
+}
+
+asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
+		unsigned long arg)
+{
+	if ((cmd == F_GETLK64) || (cmd == F_SETLK64) || (cmd == F_SETLKW64))
+		return -EINVAL;
+	return compat_sys_fcntl64(fd, cmd, arg);
+}
+
diff -ruN 2.5.63-32bit.1/include/linux/compat.h 2.5.63-32bit.2/include/linux/compat.h
--- 2.5.63-32bit.1/include/linux/compat.h	2003-01-17 14:01:07.000000000 +1100
+++ 2.5.63-32bit.2/include/linux/compat.h	2003-02-25 14:36:00.000000000 +1100
@@ -10,7 +10,6 @@
 
 #include <linux/stat.h>
 #include <linux/param.h>	/* for HZ */
-#include <linux/fcntl.h>	/* for struct flock */
 #include <asm/compat.h>
 
 #define compat_jiffies_to_clock_t(x)	\
@@ -40,8 +39,6 @@
 } compat_sigset_t;
 
 extern int cp_compat_stat(struct kstat *, struct compat_stat *);
-extern int get_compat_flock(struct flock *, struct compat_flock *);
-extern int put_compat_flock(struct flock *, struct compat_flock *);
 extern int get_compat_timespec(struct timespec *, struct compat_timespec *);
 extern int put_compat_timespec(struct timespec *, struct compat_timespec *);
 
diff -ruN 2.5.63-32bit.1/include/linux/fs.h 2.5.63-32bit.2/include/linux/fs.h
--- 2.5.63-32bit.1/include/linux/fs.h	2003-02-25 12:59:59.000000000 +1100
+++ 2.5.63-32bit.2/include/linux/fs.h	2003-02-25 14:36:00.000000000 +1100
@@ -525,8 +525,10 @@
 extern int fcntl_getlk(struct file *, struct flock *);
 extern int fcntl_setlk(struct file *, unsigned int, struct flock *);
 
+#if BITS_PER_LONG == 32
 extern int fcntl_getlk64(struct file *, struct flock64 *);
 extern int fcntl_setlk64(struct file *, unsigned int, struct flock64 *);
+#endif
 
 /* fs/locks.c */
 extern void locks_init_lock(struct file_lock *);

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 PPC64 part
  2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
@ 2003-03-04  6:00 ` Stephen Rothwell
  2003-03-04  6:02 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 3/9 SPARC64 part Stephen Rothwell
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  6:00 UTC (permalink / raw)
  To: anton; +Cc: torvalds, linux-kernel

Hi Anton,

Here is the PPC64 part of the patch.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/arch/ppc64/kernel/misc.S 2.5.63-32bit.2/arch/ppc64/kernel/misc.S
--- 2.5.63-32bit.1/arch/ppc64/kernel/misc.S	2003-02-25 12:59:28.000000000 +1100
+++ 2.5.63-32bit.2/arch/ppc64/kernel/misc.S	2003-02-25 14:35:59.000000000 +1100
@@ -557,7 +557,7 @@
 	.llong .sys32_umount
 	.llong .sys_ni_syscall		/* old lock syscall */
 	.llong .sys32_ioctl
-	.llong .sys32_fcntl		/* 55 */
+	.llong .compat_sys_fcntl	/* 55 */
 	.llong .sys_ni_syscall		/* old mpx syscall */
 	.llong .sys32_setpgid
 	.llong .sys_ni_syscall		/* old ulimit syscall */
@@ -706,7 +706,7 @@
 	.llong .sys_ni_syscall		/* reserved for MacOnLinux */
 	.llong .sys_getdents64
 	.llong .sys_pivot_root
-	.llong .sys32_fcntl64
+	.llong .compat_sys_fcntl64
 	.llong .sys_madvise		/* 205 */
 	.llong .sys_mincore
 	.llong .sys_gettid
diff -ruN 2.5.63-32bit.1/arch/ppc64/kernel/sys_ppc32.c 2.5.63-32bit.2/arch/ppc64/kernel/sys_ppc32.c
--- 2.5.63-32bit.1/arch/ppc64/kernel/sys_ppc32.c	2003-02-25 12:59:29.000000000 +1100
+++ 2.5.63-32bit.2/arch/ppc64/kernel/sys_ppc32.c	2003-02-25 14:35:59.000000000 +1100
@@ -248,32 +248,6 @@
 	return ret;
 }
 
-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;
-		mm_segment_t old_fs;
-		long ret;
-
-		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(put_compat_flock(&f, (struct compat_flock *)arg))
-			return -EFAULT;
-		return ret;
-	}
-	default:
-		return sys_fcntl(fd, cmd, (unsigned long)arg);
-	}
-}
-
 struct ncp_mount_data32_v3 {
         int version;
         unsigned int ncp_fd;
@@ -3552,13 +3526,6 @@
 	return sys_umount(name, (int)flags);
 }
 
-asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
-		return sys_fcntl(fd, cmd + F_GETLK - F_GETLK64, arg);
-	return sys32_fcntl(fd, cmd, arg);
-}
-
 struct __sysctl_args32 {
 	u32 name;
 	int nlen;
diff -ruN 2.5.63-32bit.1/include/asm-ppc64/compat.h 2.5.63-32bit.2/include/asm-ppc64/compat.h
--- 2.5.63-32bit.1/include/asm-ppc64/compat.h	2003-02-11 09:39:59.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-ppc64/compat.h	2003-02-25 14:35:59.000000000 +1100
@@ -61,7 +61,18 @@
 	compat_off_t	l_start;
 	compat_off_t	l_len;
 	compat_pid_t	l_pid;
-	short		__unused;
+};
+
+#define F_GETLK64	12	/*  using 'struct flock64' */
+#define F_SETLK64	13
+#define F_SETLKW64	14
+
+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 {
@@ -84,4 +95,7 @@
 
 typedef u32		compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_PPC64_COMPAT_H */
diff -ruN 2.5.63-32bit.1/include/asm-ppc64/fcntl.h 2.5.63-32bit.2/include/asm-ppc64/fcntl.h
--- 2.5.63-32bit.1/include/asm-ppc64/fcntl.h	2002-06-03 12:13:01.000000000 +1000
+++ 2.5.63-32bit.2/include/asm-ppc64/fcntl.h	2003-02-25 14:35:59.000000000 +1100
@@ -42,10 +42,6 @@
 #define F_SETSIG	10	/*  for sockets. */
 #define F_GETSIG	11	/*  for sockets. */
 
-#define F_GETLK64	12	/*  using 'struct flock64' */
-#define F_SETLK64	13
-#define F_SETLKW64	14
-
 /* for F_[GET|SET]FL */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
@@ -87,13 +83,6 @@
 	pid_t l_pid;
 };
 
-struct flock64 {
-	short  l_type;
-	short  l_whence;
-	loff_t l_start;
-	loff_t l_len;
-	pid_t  l_pid;
-};
-
 #define F_LINUX_SPECIFIC_BASE	1024
+
 #endif /* _PPC64_FCNTL_H */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 3/9 SPARC64 part
  2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
  2003-03-04  6:00 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 PPC64 part Stephen Rothwell
@ 2003-03-04  6:02 ` Stephen Rothwell
  2003-03-04  6:06 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 4/9 x86_64 part Stephen Rothwell
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  6:02 UTC (permalink / raw)
  To: David S. Miller; +Cc: torvalds, linux-kernel

Hi Dave,

Here is the SPARC64 part of the patch.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/arch/sparc64/kernel/sys_sparc32.c 2.5.63-32bit.2/arch/sparc64/kernel/sys_sparc32.c
--- 2.5.63-32bit.1/arch/sparc64/kernel/sys_sparc32.c	2003-02-25 12:59:31.000000000 +1100
+++ 2.5.63-32bit.2/arch/sparc64/kernel/sys_sparc32.c	2003-02-25 14:35:59.000000000 +1100
@@ -806,41 +806,6 @@
 	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)
-{
-	switch (cmd) {
-	case F_GETLK:
-	case F_SETLK:
-	case F_SETLKW:
-		{
-			struct flock f;
-			mm_segment_t old_fs;
-			long ret;
-			
-			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_compat_flock(&f, (struct compat_flock *)arg))
-				return -EFAULT;
-			return 0;
-		}
-	default:
-		return sys_fcntl(fd, cmd, (unsigned long)arg);
-	}
-}
-
-asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
-		return sys_fcntl(fd, cmd + F_GETLK - F_GETLK64, arg);
-	return sys32_fcntl(fd, cmd, arg);
-}
-
 extern asmlinkage long sys_truncate(const char * path, unsigned long length);
 extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
 
diff -ruN 2.5.63-32bit.1/arch/sparc64/kernel/systbls.S 2.5.63-32bit.2/arch/sparc64/kernel/systbls.S
--- 2.5.63-32bit.1/arch/sparc64/kernel/systbls.S	2003-02-25 12:59:31.000000000 +1100
+++ 2.5.63-32bit.2/arch/sparc64/kernel/systbls.S	2003-02-25 14:35:59.000000000 +1100
@@ -37,7 +37,7 @@
 	.word sys_madvise, sys_vhangup, sys32_truncate64, sys_mincore, sys32_getgroups16
 /*80*/	.word sys32_setgroups16, sys_getpgrp, sys_setgroups, compat_sys_setitimer, sys32_ftruncate64
 	.word sys_swapon, compat_sys_getitimer, sys_setuid, sys_sethostname, sys_setgid
-/*90*/	.word sys_dup2, sys_setfsuid, sys32_fcntl, sys32_select, sys_setfsgid
+/*90*/	.word sys_dup2, sys_setfsuid, compat_sys_fcntl, sys32_select, sys_setfsgid
 	.word sys_fsync, sys_setpriority32, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall
 /*100*/ .word sys_getpriority, sys32_rt_sigreturn, sys32_rt_sigaction, sys32_rt_sigprocmask, sys32_rt_sigpending
 	.word sys32_rt_sigtimedwait, sys32_rt_sigqueueinfo, sys32_rt_sigsuspend, sys_setresuid, sys_getresuid
@@ -50,7 +50,7 @@
 /*140*/	.word sys32_sendfile64, sys_nis_syscall, compat_sys_futex, sys_gettid, sys32_getrlimit
 	.word sys32_setrlimit, sys_pivot_root, sys32_prctl, sys32_pciconfig_read, sys32_pciconfig_write
 /*150*/	.word sys_nis_syscall, sys_nis_syscall, sys_nis_syscall, sys_poll, sys_getdents64
-	.word sys32_fcntl64, sys_ni_syscall, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount
+	.word compat_sys_fcntl64, sys_ni_syscall, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount
 /*160*/	.word sys32_sched_setaffinity, sys32_sched_getaffinity, sys_getdomainname, sys_setdomainname, sys_nis_syscall
 	.word sys_quotactl, sys_set_tid_address, sys32_mount, sys_ustat, sys_setxattr
 /*170*/	.word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys32_getdents
@@ -172,7 +172,7 @@
 	.word compat_sys_setitimer, sunos_nosys, sys_swapon
 	.word compat_sys_getitimer, sys_gethostname, sys_sethostname
 	.word sunos_getdtablesize, sys_dup2, sunos_nop
-	.word sys32_fcntl, sunos_select, sunos_nop
+	.word compat_sys_fcntl, sunos_select, sunos_nop
 	.word sys_fsync, sys_setpriority32, sunos_socket
 	.word sys_connect, sunos_accept
 /*100*/	.word sys_getpriority, sunos_send, sunos_recv
diff -ruN 2.5.63-32bit.1/include/asm-sparc64/compat.h 2.5.63-32bit.2/include/asm-sparc64/compat.h
--- 2.5.63-32bit.1/include/asm-sparc64/compat.h	2003-02-11 09:40:00.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-sparc64/compat.h	2003-02-25 14:35:59.000000000 +1100
@@ -64,6 +64,19 @@
 	short		__unused;
 };
 
+#define F_GETLK64	12
+#define F_SETLK64	13
+#define F_SETLKW64	14
+
+struct compat_flock64 {
+	short		l_type;
+	short		l_whence;
+	compat_loff_t	l_start;
+	compat_loff_t	l_len;
+	compat_pid_t	l_pid;
+	short		__unused;
+};
+
 struct compat_statfs {
 	int		f_type;
 	int		f_bsize;
@@ -84,4 +97,7 @@
 
 typedef u32		compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_SPARC64_COMPAT_H */
diff -ruN 2.5.63-32bit.1/include/asm-sparc64/fcntl.h 2.5.63-32bit.2/include/asm-sparc64/fcntl.h
--- 2.5.63-32bit.1/include/asm-sparc64/fcntl.h	2003-01-09 16:24:05.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-sparc64/fcntl.h	2003-02-25 14:35:59.000000000 +1100
@@ -36,12 +36,6 @@
 #define F_SETSIG	10	/*  for sockets. */
 #define F_GETSIG	11	/*  for sockets. */
 
-#ifdef __KERNEL__
-#define F_GETLK64	12
-#define F_SETLK64	13
-#define F_SETLKW64	14
-#endif
-
 /* for F_[GET|SET]FL */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
@@ -78,9 +72,6 @@
 	short __unused;
 };
 
-#ifdef __KERNEL__
-#define flock64	flock
-#endif
-
 #define F_LINUX_SPECIFIC_BASE	1024
+
 #endif /* !(_SPARC64_FCNTL_H) */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 4/9 x86_64 part
  2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
  2003-03-04  6:00 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 PPC64 part Stephen Rothwell
  2003-03-04  6:02 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 3/9 SPARC64 part Stephen Rothwell
@ 2003-03-04  6:06 ` Stephen Rothwell
  2003-03-04  6:10 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 5/9 ia64 part Stephen Rothwell
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  6:06 UTC (permalink / raw)
  To: Linus; +Cc: linux-kernel, ak

Hi Linus,

Here is the x86_64 part of the patch, since Andi asked me to send these to
you.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/arch/x86_64/ia32/ia32entry.S 2.5.63-32bit.2/arch/x86_64/ia32/ia32entry.S
--- 2.5.63-32bit.1/arch/x86_64/ia32/ia32entry.S	2003-02-18 11:46:36.000000000 +1100
+++ 2.5.63-32bit.2/arch/x86_64/ia32/ia32entry.S	2003-02-25 14:35:59.000000000 +1100
@@ -255,7 +255,7 @@
 	.quad sys_umount			/* new_umount */
 	.quad ni_syscall			/* old lock syscall holder */
 	.quad sys32_ioctl
-	.quad sys32_fcntl64		/* 55 */
+	.quad compat_sys_fcntl64		/* 55 */
 	.quad ni_syscall			/* old mpx syscall holder */
 	.quad sys_setpgid
 	.quad ni_syscall			/* old ulimit syscall holder */
@@ -421,7 +421,7 @@
 	.quad sys_mincore
 	.quad sys_madvise
 	.quad sys_getdents64	/* 220 getdents64 */ 
-	.quad sys32_fcntl64	
+	.quad compat_sys_fcntl64	
 	.quad sys_ni_syscall	/* tux */
 	.quad sys_ni_syscall    /* security */
 	.quad sys_gettid	
diff -ruN 2.5.63-32bit.1/arch/x86_64/ia32/sys_ia32.c 2.5.63-32bit.2/arch/x86_64/ia32/sys_ia32.c
--- 2.5.63-32bit.1/arch/x86_64/ia32/sys_ia32.c	2003-02-25 12:59:32.000000000 +1100
+++ 2.5.63-32bit.2/arch/x86_64/ia32/sys_ia32.c	2003-02-25 14:35:59.000000000 +1100
@@ -1016,102 +1016,6 @@
 	return ret;
 }
 
-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);
-
-
-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;
-			mm_segment_t old_fs;
-			long ret;
-			
-			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_compat_flock(&f, (struct compat_flock *)arg))
-				return -EFAULT;
-			return 0;
-		}
-	case F_GETLK64: 
-	case F_SETLK64: 
-	case F_SETLKW64: 
-		return sys32_fcntl64(fd,cmd,arg); 
-
-	default:
-		return sys_fcntl(fd, cmd, (unsigned long)arg);
-	}
-}
-
-static inline int get_flock64(struct ia32_flock64 *fl32, struct flock *fl64)
-{
-	if (access_ok(fl32, sizeof(struct ia32_flock64), VERIFY_WRITE)) {
-		int ret = __get_user(fl64->l_type, &fl32->l_type); 
-		ret |= __get_user(fl64->l_whence, &fl32->l_whence);
-		ret |= __get_user(fl64->l_start, &fl32->l_start); 
-		ret |= __get_user(fl64->l_len, &fl32->l_len); 
-		ret |= __get_user(fl64->l_pid, &fl32->l_pid); 
-		return ret; 
-		}
-	return -EFAULT; 
-}
-
-static inline int put_flock64(struct ia32_flock64 *fl32, struct flock *fl64)
-{
-	if (access_ok(fl32, sizeof(struct ia32_flock64), VERIFY_WRITE)) {
-		int ret = __put_user(fl64->l_type, &fl32->l_type); 
-		ret |= __put_user(fl64->l_whence, &fl32->l_whence);
-		ret |= __put_user(fl64->l_start, &fl32->l_start); 
-		ret |= __put_user(fl64->l_len, &fl32->l_len); 
-		ret |= __put_user(fl64->l_pid, &fl32->l_pid); 
-		return ret; 
-	}
-	return -EFAULT; 
-}
-
-asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	struct flock fl64;  
-	mm_segment_t oldfs = get_fs(); 
-	int ret = 0; 
-	int oldcmd = cmd;
-	unsigned long oldarg = arg;
-
-	switch (cmd) {
-	case F_GETLK64: 
-		cmd = F_GETLK; 
-		goto cnv;
-	case F_SETLK64: 
-		cmd = F_SETLK; 
-		goto cnv; 
-	case F_SETLKW64:
-		cmd = F_SETLKW; 
-	cnv:
-		ret = get_flock64((struct ia32_flock64 *)arg, &fl64); 
-		arg = (unsigned long)&fl64; 
-		set_fs(KERNEL_DS); 
-		break; 
-	case F_GETLK:
-	case F_SETLK:
-	case F_SETLKW:
-		return sys32_fcntl(fd,cmd,arg); 
-	}
-	if (!ret)
-		ret = sys_fcntl(fd, cmd, arg);
-	set_fs(oldfs); 
-	if (oldcmd == F_GETLK64 && !ret)
-		ret = put_flock64((struct ia32_flock64 *)oldarg, &fl64); 
-	return ret; 
-}
-
 int sys32_ni_syscall(int call)
 { 
 	printk(KERN_INFO "IA32 syscall %d from %s not implemented\n", call,
diff -ruN 2.5.63-32bit.1/include/asm-x86_64/compat.h 2.5.63-32bit.2/include/asm-x86_64/compat.h
--- 2.5.63-32bit.1/include/asm-x86_64/compat.h	2003-02-11 09:40:00.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-x86_64/compat.h	2003-02-25 14:36:00.000000000 +1100
@@ -68,6 +68,22 @@
 	compat_pid_t	l_pid;
 };
 
+#define F_GETLK64	12	/*  using 'struct flock64' */
+#define F_SETLK64	13
+#define F_SETLKW64	14
+
+/*
+ * IA32 uses 4 byte alignment for 64 bit quantities,
+ * so we need to pack this structure.
+ */
+struct compat_flock64 {
+	short		l_type;
+	short		l_whence;
+	compat_loff_t	l_start;
+	compat_loff_t	l_len;
+	compat_pid_t	l_pid;
+} __attribute__((packed));
+
 struct compat_statfs {
 	int		f_type;
 	int		f_bsize;
@@ -88,4 +104,6 @@
 
 typedef u32               compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+
 #endif /* _ASM_X86_64_COMPAT_H */
diff -ruN 2.5.63-32bit.1/include/asm-x86_64/fcntl.h 2.5.63-32bit.2/include/asm-x86_64/fcntl.h
--- 2.5.63-32bit.1/include/asm-x86_64/fcntl.h	2002-02-20 14:13:21.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-x86_64/fcntl.h	2003-02-25 14:36:00.000000000 +1100
@@ -72,8 +72,4 @@
 
 #define F_LINUX_SPECIFIC_BASE	1024
 
-#ifdef __KERNEL__
-#define flock64	flock
-#endif
-
 #endif /* !_X86_64_FCNTL_H */
diff -ruN 2.5.63-32bit.1/include/asm-x86_64/ia32.h 2.5.63-32bit.2/include/asm-x86_64/ia32.h
--- 2.5.63-32bit.1/include/asm-x86_64/ia32.h	2003-02-15 23:20:00.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-x86_64/ia32.h	2003-02-25 14:36:00.000000000 +1100
@@ -11,18 +11,6 @@
  * 32 bit structures for IA32 support.
  */
 
-struct ia32_flock64 {
-	short  l_type;
-	short  l_whence;
-	loff_t l_start;  /* unnatural alignment */
-	loff_t l_len;
-	pid_t  l_pid;
-} __attribute__((packed));
-
-#define F_GETLK64	12	/*  using 'struct flock64' */
-#define F_SETLK64	13
-#define F_SETLKW64	14
-
 #include <asm/sigcontext32.h>
 
 /* signal.h */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 5/9 ia64 part
  2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
                   ` (2 preceding siblings ...)
  2003-03-04  6:06 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 4/9 x86_64 part Stephen Rothwell
@ 2003-03-04  6:10 ` Stephen Rothwell
  2003-03-04  6:12 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 6/9 s390x part Stephen Rothwell
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  6:10 UTC (permalink / raw)
  To: davidm; +Cc: linux-kernel, Linus

Hi David,

Here is the IA64 part of the patch.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/arch/ia64/ia32/ia32_entry.S 2.5.63-32bit.2/arch/ia64/ia32/ia32_entry.S
--- 2.5.63-32bit.1/arch/ia64/ia32/ia32_entry.S	2003-02-25 14:35:17.000000000 +1100
+++ 2.5.63-32bit.2/arch/ia64/ia32/ia32_entry.S	2003-02-25 14:35:59.000000000 +1100
@@ -253,7 +253,7 @@
 	data8 sys_umount	  /* recycled never used phys( */
 	data8 sys32_ni_syscall	  /* old lock syscall holder */
 	data8 sys32_ioctl
-	data8 sys32_fcntl	  /* 55 */
+	data8 compat_sys_fcntl	  /* 55 */
 	data8 sys32_ni_syscall	  /* old mpx syscall holder */
 	data8 sys_setpgid
 	data8 sys32_ni_syscall	  /* old ulimit syscall holder */
@@ -419,7 +419,7 @@
 	data8 sys_mincore
 	data8 sys_madvise
 	data8 sys_getdents64	  /* 220 */
-	data8 sys32_fcntl64
+	data8 compat_sys_fcntl64
 	data8 sys_ni_syscall		/* reserved for TUX */
 	data8 sys_ni_syscall		/* reserved for Security */
 	data8 sys_gettid
diff -ruN 2.5.63-32bit.1/arch/ia64/ia32/sys_ia32.c 2.5.63-32bit.2/arch/ia64/ia32/sys_ia32.c
--- 2.5.63-32bit.1/arch/ia64/ia32/sys_ia32.c	2003-02-25 12:59:25.000000000 +1100
+++ 2.5.63-32bit.2/arch/ia64/ia32/sys_ia32.c	2003-02-25 14:35:59.000000000 +1100
@@ -2966,38 +2966,6 @@
 	return ret;
 }
 
-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 int arg)
-{
-	mm_segment_t old_fs;
-	struct flock f;
-	long ret;
-
-	switch (cmd) {
-	      case F_GETLK:
-	      case F_SETLK:
-	      case F_SETLKW:
-		if (get_compat_flock(&f, (struct compat_flock *) A(arg)))
-			return -EFAULT;
-		old_fs = get_fs();
-		set_fs(KERNEL_DS);
-		ret = sys_fcntl(fd, cmd, (unsigned long) &f);
-		set_fs(old_fs);
-		if (cmd == F_GETLK && put_compat_flock(&f, (struct compat_flock *) A(arg)))
-			return -EFAULT;
-		return ret;
-
-	      default:
-		/*
-		 *  `sys_fcntl' lies about arg, for the F_SETOWN
-		 *  sub-function arg can have a negative value.
-		 */
-		return sys_fcntl(fd, cmd, arg);
-	}
-}
-
 asmlinkage long sys_ni_syscall(void);
 
 asmlinkage long
@@ -3288,66 +3256,6 @@
 	return ret;
 }
 
-/*
- * Unfortunately, the x86 compiler aligns variables of type "long long" to a 4 byte boundary
- * only, which means that the x86 version of "struct flock64" doesn't match the ia64 version
- * of struct flock.
- */
-
-static inline long
-ia32_put_flock (struct flock *l, unsigned long addr)
-{
-	return (put_user(l->l_type, (short *) addr)
-		| put_user(l->l_whence, (short *) (addr + 2))
-		| put_user(l->l_start, (long *) (addr + 4))
-		| put_user(l->l_len, (long *) (addr + 12))
-		| put_user(l->l_pid, (int *) (addr + 20)));
-}
-
-static inline long
-ia32_get_flock (struct flock *l, unsigned long addr)
-{
-	unsigned int start_lo, start_hi, len_lo, len_hi;
-	int err = (get_user(l->l_type, (short *) addr)
-		   | get_user(l->l_whence, (short *) (addr + 2))
-		   | get_user(start_lo, (int *) (addr + 4))
-		   | get_user(start_hi, (int *) (addr + 8))
-		   | get_user(len_lo, (int *) (addr + 12))
-		   | get_user(len_hi, (int *) (addr + 16))
-		   | get_user(l->l_pid, (int *) (addr + 20)));
-	l->l_start = ((unsigned long) start_hi << 32) | start_lo;
-	l->l_len = ((unsigned long) len_hi << 32) | len_lo;
-	return err;
-}
-
-asmlinkage long
-sys32_fcntl64 (unsigned int fd, unsigned int cmd, unsigned int arg)
-{
-	mm_segment_t old_fs;
-	struct flock f;
-	long ret;
-
-	switch (cmd) {
-	      case F_GETLK64:
-	      case F_SETLK64:
-	      case F_SETLKW64:
-		if (ia32_get_flock(&f, arg))
-			return -EFAULT;
-		old_fs = get_fs();
-		set_fs(KERNEL_DS);
-		ret = sys_fcntl(fd, cmd, (unsigned long) &f);
-		set_fs(old_fs);
-		if (cmd == F_GETLK && ia32_put_flock(&f, arg))
-			return -EFAULT;
-		break;
-
-	      default:
-		ret = sys32_fcntl(fd, cmd, arg);
-		break;
-	}
-	return ret;
-}
-
 asmlinkage long
 sys32_truncate64 (unsigned int path, unsigned int len_lo, unsigned int len_hi)
 {
diff -ruN 2.5.63-32bit.1/include/asm-ia64/compat.h 2.5.63-32bit.2/include/asm-ia64/compat.h
--- 2.5.63-32bit.1/include/asm-ia64/compat.h	2003-02-11 09:39:57.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-ia64/compat.h	2003-02-25 14:35:59.000000000 +1100
@@ -68,6 +68,22 @@
 	compat_pid_t	l_pid;
 };
 
+#define F_GETLK64	12
+#define F_SETLK64	13
+#define F_SETLKW64	14
+
+/*
+ * IA32 uses 4 byte alignment for 64 bit quantities,
+ * so we need to pack this structure.
+ */
+struct compat_flock64 {
+	short		l_type;
+	short		l_whence;
+	compat_loff_t	l_start;
+	compat_loff_t	l_len;
+	compat_pid_t	l_pid;
+} __attribute__((packed));
+
 struct compat_statfs {
 	int		f_type;
 	int		f_bsize;
@@ -88,4 +104,7 @@
 
 typedef u32		compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_IA64_COMPAT_H */
diff -ruN 2.5.63-32bit.1/include/asm-ia64/fcntl.h 2.5.63-32bit.2/include/asm-ia64/fcntl.h
--- 2.5.63-32bit.1/include/asm-ia64/fcntl.h	2000-10-10 11:54:58.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-ia64/fcntl.h	2003-02-25 14:35:59.000000000 +1100
@@ -78,9 +78,6 @@
 	pid_t l_pid;
 };
 
-#ifdef __KERNEL__
-# define flock64	flock
-#endif
-
 #define F_LINUX_SPECIFIC_BASE	1024
+
 #endif /* _ASM_IA64_FCNTL_H */
diff -ruN 2.5.63-32bit.1/include/asm-ia64/ia32.h 2.5.63-32bit.2/include/asm-ia64/ia32.h
--- 2.5.63-32bit.1/include/asm-ia64/ia32.h	2003-02-11 09:39:57.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-ia64/ia32.h	2003-02-25 14:35:59.000000000 +1100
@@ -18,10 +18,6 @@
 #define IA32_PAGE_ALIGN(addr)	(((addr) + IA32_PAGE_SIZE - 1) & IA32_PAGE_MASK)
 #define IA32_CLOCKS_PER_SEC	100	/* Cast in stone for IA32 Linux */
 
-#define F_GETLK64	12
-#define F_SETLK64	13
-#define F_SETLKW64	14
-
 /* sigcontext.h */
 /*
  * As documented in the iBCS2 standard..

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 6/9 s390x part
  2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
                   ` (3 preceding siblings ...)
  2003-03-04  6:10 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 5/9 ia64 part Stephen Rothwell
@ 2003-03-04  6:12 ` Stephen Rothwell
  2003-03-04  6:15 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 7/9 MIPS64 part Stephen Rothwell
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  6:12 UTC (permalink / raw)
  To: Linus; +Cc: linux-kernel, schwidefsky

Hi Linus,

Here is the s390x part with Martin's blessing (hopefully).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/arch/s390x/kernel/entry.S 2.5.63-32bit.2/arch/s390x/kernel/entry.S
--- 2.5.63-32bit.1/arch/s390x/kernel/entry.S	2003-02-25 12:59:29.000000000 +1100
+++ 2.5.63-32bit.2/arch/s390x/kernel/entry.S	2003-02-25 14:35:59.000000000 +1100
@@ -452,7 +452,7 @@
         .long  SYSCALL(sys_umount,sys32_umount_wrapper)
         .long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old lock syscall */
         .long  SYSCALL(sys_ioctl,sys32_ioctl_wrapper)
-        .long  SYSCALL(sys_fcntl,sys32_fcntl_wrapper)   /* 55 */
+        .long  SYSCALL(sys_fcntl,compat_sys_fcntl_wrapper)   /* 55 */
         .long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* intel mpx syscall */
         .long  SYSCALL(sys_setpgid,sys32_setpgid_wrapper)
         .long  SYSCALL(sys_ni_syscall,sys_ni_syscall) /* old ulimit syscall */
@@ -618,7 +618,7 @@
         .long  SYSCALL(sys_mincore,sys32_mincore_wrapper)
         .long  SYSCALL(sys_madvise,sys32_madvise_wrapper)
 	.long  SYSCALL(sys_getdents64,sys32_getdents64_wrapper)/* 220 */
-	.long  SYSCALL(sys_ni_syscall,sys32_fcntl64_wrapper)
+	.long  SYSCALL(sys_ni_syscall,compat_sys_fcntl64_wrapper)
 	.long  SYSCALL(sys_readahead,sys32_readahead)
 	.long  SYSCALL(sys_ni_syscall,sys32_sendfile64)
 	.long  SYSCALL(sys_setxattr,sys32_setxattr_wrapper)
diff -ruN 2.5.63-32bit.1/arch/s390x/kernel/linux32.c 2.5.63-32bit.2/arch/s390x/kernel/linux32.c
--- 2.5.63-32bit.1/arch/s390x/kernel/linux32.c	2003-02-25 12:59:30.000000000 +1100
+++ 2.5.63-32bit.2/arch/s390x/kernel/linux32.c	2003-02-25 14:35:59.000000000 +1100
@@ -834,57 +834,6 @@
 	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)
-{
-	switch (cmd) {
-	case F_GETLK:
-		{
-			struct flock f;
-			mm_segment_t old_fs;
-			long ret;
-			
-			if(get_compat_flock(&f, (struct compat_flock *)A(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 (f.l_start >= 0x7fffffffUL ||
-			    f.l_start + f.l_len >= 0x7fffffffUL)
-				return -EOVERFLOW;
-			if(put_compat_flock(&f, (struct compat_flock *)A(arg)))
-				return -EFAULT;
-			return 0;
-		}
-	case F_SETLK:
-	case F_SETLKW:
-		{
-			struct flock f;
-			mm_segment_t old_fs;
-			long ret;
-			
-			if(get_compat_flock(&f, (struct compat_flock *)A(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;
-			return 0;
-		}
-	default:
-		return sys_fcntl(fd, cmd, (unsigned long)arg);
-	}
-}
-
-asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
-		return sys_fcntl(fd, cmd + F_GETLK - F_GETLK64, arg);
-	return sys32_fcntl(fd, cmd, arg);
-}
-
 extern asmlinkage long sys_truncate(const char * path, unsigned long length);
 extern asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length);
 
diff -ruN 2.5.63-32bit.1/arch/s390x/kernel/linux32.h 2.5.63-32bit.2/arch/s390x/kernel/linux32.h
--- 2.5.63-32bit.1/arch/s390x/kernel/linux32.h	2003-01-17 14:01:01.000000000 +1100
+++ 2.5.63-32bit.2/arch/s390x/kernel/linux32.h	2003-02-25 14:35:59.000000000 +1100
@@ -21,10 +21,6 @@
         __s32   msgtyp;
 };
 
-#define F_GETLK64       12
-#define F_SETLK64       13
-#define F_SETLKW64      14    
-
 struct old_sigaction32 {
        __u32			sa_handler;	/* Really a pointer, but need to deal with 32 bits */
        compat_old_sigset_t	sa_mask;	/* A 32 bit mask */
diff -ruN 2.5.63-32bit.1/arch/s390x/kernel/wrapper32.S 2.5.63-32bit.2/arch/s390x/kernel/wrapper32.S
--- 2.5.63-32bit.1/arch/s390x/kernel/wrapper32.S	2003-02-25 12:59:30.000000000 +1100
+++ 2.5.63-32bit.2/arch/s390x/kernel/wrapper32.S	2003-02-25 14:35:59.000000000 +1100
@@ -227,12 +227,12 @@
 	llgfr	%r4,%r4			# unsigned int
 	jg	sys32_ioctl		# branch to system call
 
-	.globl  sys32_fcntl_wrapper 
-sys32_fcntl_wrapper:
+	.globl  compat_sys_fcntl_wrapper 
+compat_sys_fcntl_wrapper:
 	llgfr	%r2,%r2			# unsigned int
 	llgfr	%r3,%r3			# unsigned int 
 	llgfr	%r4,%r4			# unsigned long
-	jg	sys32_fcntl		# branch to system call
+	jg	compat_sys_fcntl	# branch to system call
 
 	.globl  sys32_setpgid_wrapper 
 sys32_setpgid_wrapper:
@@ -1050,12 +1050,12 @@
 	llgfr	%r4,%r4			# unsigned int
 	jg	sys_getdents64		# branch to system call
 
-	.globl  sys32_fcntl64_wrapper 
-sys32_fcntl64_wrapper:
+	.globl  compat_sys_fcntl64_wrapper 
+compat_sys_fcntl64_wrapper:
 	llgfr	%r2,%r2			# unsigned int
 	llgfr	%r3,%r3			# unsigned int 
 	llgfr	%r4,%r4			# unsigned long
-	jg	sys32_fcntl64		# branch to system call
+	jg	compat_sys_fcntl64	# branch to system call
 
 	.globl	sys32_stat64_wrapper
 sys32_stat64_wrapper:
diff -ruN 2.5.63-32bit.1/include/asm-s390x/compat.h 2.5.63-32bit.2/include/asm-s390x/compat.h
--- 2.5.63-32bit.1/include/asm-s390x/compat.h	2003-02-25 12:59:57.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-s390x/compat.h	2003-02-25 14:35:59.000000000 +1100
@@ -64,7 +64,18 @@
 	compat_off_t	l_start;
 	compat_off_t	l_len;
 	compat_pid_t	l_pid;
-	short		__unused;
+};
+
+#define F_GETLK64       12
+#define F_SETLK64       13
+#define F_SETLKW64      14    
+
+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 {
@@ -87,4 +98,7 @@
 
 typedef u32		compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_S390X_COMPAT_H */
diff -ruN 2.5.63-32bit.1/include/asm-s390x/fcntl.h 2.5.63-32bit.2/include/asm-s390x/fcntl.h
--- 2.5.63-32bit.1/include/asm-s390x/fcntl.h	2001-11-10 09:11:15.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-s390x/fcntl.h	2003-02-25 14:35:59.000000000 +1100
@@ -80,6 +80,4 @@
 
 #define F_LINUX_SPECIFIC_BASE  1024
 
-#define flock64   flock
-
 #endif

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 7/9 MIPS64 part
  2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
                   ` (4 preceding siblings ...)
  2003-03-04  6:12 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 6/9 s390x part Stephen Rothwell
@ 2003-03-04  6:15 ` Stephen Rothwell
  2003-03-04  6:17 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 8/9 PARISC part Stephen Rothwell
  2003-03-04  6:20 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 9/9 Alpha part Stephen Rothwell
  7 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  6:15 UTC (permalink / raw)
  To: ralf; +Cc: torvalds, linux-kernel

Hi Ralf,

Here is the MIPS64 part.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/arch/mips64/kernel/linux32.c 2.5.63-32bit.2/arch/mips64/kernel/linux32.c
--- 2.5.63-32bit.1/arch/mips64/kernel/linux32.c	2003-02-25 14:35:17.000000000 +1100
+++ 2.5.63-32bit.2/arch/mips64/kernel/linux32.c	2003-02-25 14:35:59.000000000 +1100
@@ -1068,50 +1068,6 @@
 	return sys_setsockopt(fd, level, optname, optval, optlen);
 }
 
-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;
-			mm_segment_t old_fs;
-			long ret;
-			
-			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 (put_compat_flock(&f, (struct compat_flock *)arg))
-				return -EFAULT;
-			return ret;
-		}
-	default:
-		return sys_fcntl(fd, cmd, (unsigned long)arg);
-	}
-}
-
-asmlinkage long
-sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	switch (cmd) {
-	case F_GETLK64:
-		return sys_fcntl(fd, F_GETLK, arg);
-	case F_SETLK64:
-		return sys_fcntl(fd, F_SETLK, arg);
-	case F_SETLKW64:
-		return sys_fcntl(fd, F_SETLKW, arg);
-	}
-
-	return sys32_fcntl(fd, cmd, arg);
-}
-
 struct msgbuf32 { s32 mtype; char mtext[1]; };
 
 struct ipc_perm32
diff -ruN 2.5.63-32bit.1/arch/mips64/kernel/scall_o32.S 2.5.63-32bit.2/arch/mips64/kernel/scall_o32.S
--- 2.5.63-32bit.1/arch/mips64/kernel/scall_o32.S	2003-02-25 14:35:17.000000000 +1100
+++ 2.5.63-32bit.2/arch/mips64/kernel/scall_o32.S	2003-02-25 14:35:59.000000000 +1100
@@ -288,7 +288,7 @@
 	sys	sys_umount	2
 	sys	sys_ni_syscall	0
 	sys	sys32_ioctl	3
-	sys	sys32_fcntl	3			/* 4055 */
+	sys	compat_sys_fcntl	3		/* 4055 */
 	sys	sys_ni_syscall	2
 	sys	sys_setpgid	2
 	sys	sys_ni_syscall, 0
@@ -453,7 +453,7 @@
 	sys	sys_mincore	3
 	sys	sys_madvise	3
 	sys	sys_getdents64	3
-	sys	sys32_fcntl64	3			/* 4220 */
+	sys	compat_sys_fcntl64	3		/* 4220 */
 	sys	sys32_gettid	0
 	sys	sys32_tkill	2
 	.endm
diff -ruN 2.5.63-32bit.1/include/asm-mips64/compat.h 2.5.63-32bit.2/include/asm-mips64/compat.h
--- 2.5.63-32bit.1/include/asm-mips64/compat.h	2003-02-25 14:35:17.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-mips64/compat.h	2003-02-25 14:35:59.000000000 +1100
@@ -62,8 +62,21 @@
 	short		l_whence;
 	compat_off_t	l_start;
 	compat_off_t	l_len;
+	s32		l_sysid;	/* ABI junk, unused on Linux */
+	compat_pid_t	l_pid;
+	s32		pad[4];		/* ABI junk, unused on Linux */
+};
+
+#define F_GETLK64	33	/*  using 'struct flock64' */
+#define F_SETLK64	34
+#define F_SETLKW64	35
+
+struct compat_flock64 {
+	short		l_type;
+	short		l_whence;
+	compat_loff_t	l_start;
+	compat_loff_t	l_len;
 	compat_pid_t	l_pid;
-	short		__unused;
 };
 
 struct compat_statfs {
@@ -87,4 +100,7 @@
 
 typedef u32		compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_MIPS64_COMPAT_H */
diff -ruN 2.5.63-32bit.1/include/asm-mips64/fcntl.h 2.5.63-32bit.2/include/asm-mips64/fcntl.h
--- 2.5.63-32bit.1/include/asm-mips64/fcntl.h	2001-09-10 03:43:02.000000000 +1000
+++ 2.5.63-32bit.2/include/asm-mips64/fcntl.h	2003-02-25 14:35:59.000000000 +1100
@@ -43,12 +43,6 @@
 #define F_SETSIG	10	/*  for sockets. */
 #define F_GETSIG	11	/*  for sockets. */
 
-#ifdef __KERNEL__
-#define F_GETLK64	33	/*  using 'struct flock64' */
-#define F_SETLK64	34
-#define F_SETLKW64	35
-#endif
-
 /* for F_[GET|SET]FL */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
@@ -86,10 +80,6 @@
 	long  pad[4];			/* ZZZZZZZZZZZZZZZZZZZZZZZZZZ */
 } flock_t;
 
-#ifdef __KERNEL__
-#define flock64		flock
-#endif
-
 #define F_LINUX_SPECIFIC_BASE	1024
 
 #endif /* _ASM_FCNTL_H */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 8/9 PARISC part
  2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
                   ` (5 preceding siblings ...)
  2003-03-04  6:15 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 7/9 MIPS64 part Stephen Rothwell
@ 2003-03-04  6:17 ` Stephen Rothwell
  2003-03-04  6:20 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 9/9 Alpha part Stephen Rothwell
  7 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  6:17 UTC (permalink / raw)
  To: Linus; +Cc: linux-kernel, matthew

Hi Linus,

Here is the PARISC part of the patch as Willy asked me to send these
directly to you.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/arch/parisc/kernel/sys_parisc32.c 2.5.63-32bit.2/arch/parisc/kernel/sys_parisc32.c
--- 2.5.63-32bit.1/arch/parisc/kernel/sys_parisc32.c	2003-02-18 11:46:33.000000000 +1100
+++ 2.5.63-32bit.2/arch/parisc/kernel/sys_parisc32.c	2003-02-25 14:35:59.000000000 +1100
@@ -316,35 +316,6 @@
     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 {
@@ -2043,28 +2014,6 @@
 	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 -ruN 2.5.63-32bit.1/arch/parisc/kernel/syscall.S 2.5.63-32bit.2/arch/parisc/kernel/syscall.S
--- 2.5.63-32bit.1/arch/parisc/kernel/syscall.S	2003-02-18 11:46:33.000000000 +1100
+++ 2.5.63-32bit.2/arch/parisc/kernel/syscall.S	2003-02-28 15:14:47.000000000 +1100
@@ -409,8 +409,7 @@
 	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 @@
 	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 -ruN 2.5.63-32bit.1/include/asm-parisc/compat.h 2.5.63-32bit.2/include/asm-parisc/compat.h
--- 2.5.63-32bit.1/include/asm-parisc/compat.h	2003-02-11 09:39:59.000000000 +1100
+++ 2.5.63-32bit.2/include/asm-parisc/compat.h	2003-02-25 14:35:59.000000000 +1100
@@ -72,6 +72,14 @@
 	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_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_PARISC_COMPAT_H */

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 9/9 Alpha part
  2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
                   ` (6 preceding siblings ...)
  2003-03-04  6:17 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 8/9 PARISC part Stephen Rothwell
@ 2003-03-04  6:20 ` Stephen Rothwell
  7 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-04  6:20 UTC (permalink / raw)
  To: rth; +Cc: torvalds, linux-kernel

Hi Richard,

This is only partly to do with the other parts of this patch set.  All it
does is remove struct flock64 from the Alpha port.  It requires the generic
part of the patch set.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.63-32bit.1/include/asm-alpha/fcntl.h 2.5.63-32bit.2/include/asm-alpha/fcntl.h
--- 2.5.63-32bit.1/include/asm-alpha/fcntl.h	2001-09-18 06:16:30.000000000 +1000
+++ 2.5.63-32bit.2/include/asm-alpha/fcntl.h	2003-02-25 14:35:59.000000000 +1100
@@ -69,9 +69,6 @@
 	__kernel_pid_t l_pid;
 };
 
-#ifdef __KERNEL__
-#define flock64	flock
-#endif
 #define F_LINUX_SPECIFIC_BASE  1024
 
 #endif

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 ppc64 part
  2003-03-11  0:41 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
@ 2003-03-11  0:47 ` Stephen Rothwell
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2003-03-11  0:47 UTC (permalink / raw)
  To: anton; +Cc: torvalds, linux-kernel

Hi Anton,

Here is the ppc64 part.  Please apply after Linus has applied the generic
part.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.64-2003030918-32bit.1/arch/ppc64/kernel/misc.S 2.5.64-2003030918-32bit.2/arch/ppc64/kernel/misc.S
--- 2.5.64-2003030918-32bit.1/arch/ppc64/kernel/misc.S	2003-02-25 12:59:28.000000000 +1100
+++ 2.5.64-2003030918-32bit.2/arch/ppc64/kernel/misc.S	2003-03-09 20:34:44.000000000 +1100
@@ -557,7 +557,7 @@
 	.llong .sys32_umount
 	.llong .sys_ni_syscall		/* old lock syscall */
 	.llong .sys32_ioctl
-	.llong .sys32_fcntl		/* 55 */
+	.llong .compat_sys_fcntl	/* 55 */
 	.llong .sys_ni_syscall		/* old mpx syscall */
 	.llong .sys32_setpgid
 	.llong .sys_ni_syscall		/* old ulimit syscall */
@@ -706,7 +706,7 @@
 	.llong .sys_ni_syscall		/* reserved for MacOnLinux */
 	.llong .sys_getdents64
 	.llong .sys_pivot_root
-	.llong .sys32_fcntl64
+	.llong .compat_sys_fcntl64
 	.llong .sys_madvise		/* 205 */
 	.llong .sys_mincore
 	.llong .sys_gettid
diff -ruN 2.5.64-2003030918-32bit.1/arch/ppc64/kernel/sys_ppc32.c 2.5.64-2003030918-32bit.2/arch/ppc64/kernel/sys_ppc32.c
--- 2.5.64-2003030918-32bit.1/arch/ppc64/kernel/sys_ppc32.c	2003-02-25 12:59:29.000000000 +1100
+++ 2.5.64-2003030918-32bit.2/arch/ppc64/kernel/sys_ppc32.c	2003-03-09 20:34:44.000000000 +1100
@@ -248,32 +248,6 @@
 	return ret;
 }
 
-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;
-		mm_segment_t old_fs;
-		long ret;
-
-		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(put_compat_flock(&f, (struct compat_flock *)arg))
-			return -EFAULT;
-		return ret;
-	}
-	default:
-		return sys_fcntl(fd, cmd, (unsigned long)arg);
-	}
-}
-
 struct ncp_mount_data32_v3 {
         int version;
         unsigned int ncp_fd;
@@ -3552,13 +3526,6 @@
 	return sys_umount(name, (int)flags);
 }
 
-asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg)
-{
-	if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
-		return sys_fcntl(fd, cmd + F_GETLK - F_GETLK64, arg);
-	return sys32_fcntl(fd, cmd, arg);
-}
-
 struct __sysctl_args32 {
 	u32 name;
 	int nlen;
diff -ruN 2.5.64-2003030918-32bit.1/include/asm-ppc64/compat.h 2.5.64-2003030918-32bit.2/include/asm-ppc64/compat.h
--- 2.5.64-2003030918-32bit.1/include/asm-ppc64/compat.h	2003-02-11 09:39:59.000000000 +1100
+++ 2.5.64-2003030918-32bit.2/include/asm-ppc64/compat.h	2003-03-09 20:34:45.000000000 +1100
@@ -61,7 +61,18 @@
 	compat_off_t	l_start;
 	compat_off_t	l_len;
 	compat_pid_t	l_pid;
-	short		__unused;
+};
+
+#define F_GETLK64	12	/*  using 'struct flock64' */
+#define F_SETLK64	13
+#define F_SETLKW64	14
+
+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 {
@@ -84,4 +95,7 @@
 
 typedef u32		compat_sigset_word;
 
+#define COMPAT_OFF_T_MAX	0x7fffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
+
 #endif /* _ASM_PPC64_COMPAT_H */
diff -ruN 2.5.64-2003030918-32bit.1/include/asm-ppc64/fcntl.h 2.5.64-2003030918-32bit.2/include/asm-ppc64/fcntl.h
--- 2.5.64-2003030918-32bit.1/include/asm-ppc64/fcntl.h	2002-06-03 12:13:01.000000000 +1000
+++ 2.5.64-2003030918-32bit.2/include/asm-ppc64/fcntl.h	2003-03-09 20:34:45.000000000 +1100
@@ -42,10 +42,6 @@
 #define F_SETSIG	10	/*  for sockets. */
 #define F_GETSIG	11	/*  for sockets. */
 
-#define F_GETLK64	12	/*  using 'struct flock64' */
-#define F_SETLK64	13
-#define F_SETLKW64	14
-
 /* for F_[GET|SET]FL */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
@@ -87,13 +83,6 @@
 	pid_t l_pid;
 };
 
-struct flock64 {
-	short  l_type;
-	short  l_whence;
-	loff_t l_start;
-	loff_t l_len;
-	pid_t  l_pid;
-};
-
 #define F_LINUX_SPECIFIC_BASE	1024
+
 #endif /* _PPC64_FCNTL_H */

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-03-11  0:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-04  5:58 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
2003-03-04  6:00 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 PPC64 part Stephen Rothwell
2003-03-04  6:02 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 3/9 SPARC64 part Stephen Rothwell
2003-03-04  6:06 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 4/9 x86_64 part Stephen Rothwell
2003-03-04  6:10 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 5/9 ia64 part Stephen Rothwell
2003-03-04  6:12 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 6/9 s390x part Stephen Rothwell
2003-03-04  6:15 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 7/9 MIPS64 part Stephen Rothwell
2003-03-04  6:17 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 8/9 PARISC part Stephen Rothwell
2003-03-04  6:20 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 9/9 Alpha part Stephen Rothwell
2003-03-11  0:41 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
2003-03-11  0:47 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 ppc64 part Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).