linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: anton@samba.org
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [PATCH][COMPAT] compat_sys_fcntl{,64} 2/9 ppc64 part
Date: Tue, 11 Mar 2003 11:47:29 +1100	[thread overview]
Message-ID: <20030311114729.75a3885f.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20030311114113.44abed66.sfr@canb.auug.org.au>

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 */

  reply	other threads:[~2003-03-11  0:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-11  0:41 [PATCH][COMPAT] compat_sys_fcntl{,64} 1/9 Generic part Stephen Rothwell
2003-03-11  0:47 ` Stephen Rothwell [this message]
2003-03-11  0:50 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 3/9 sparc64 part Stephen Rothwell
2003-03-11 23:42   ` David S. Miller
2003-03-12  4:51     ` Anton Blanchard
2003-03-11  0:52 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 4/9 x86_64 part Stephen Rothwell
2003-03-11  0:54 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 5/9 ia64 part Stephen Rothwell
2003-03-11  0:57 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 6/9 s390x part Stephen Rothwell
2003-03-11  0:59 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 7/9 mips64 part Stephen Rothwell
2003-03-11  1:01 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 8/9 parisc part Stephen Rothwell
2003-03-11  1:08 ` [PATCH][COMPAT] compat_sys_fcntl{,64} 9/9 Aalpha part Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030311114729.75a3885f.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).