From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linus <torvalds@transmeta.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
anton@samba.org, "David S. Miller" <davem@redhat.com>,
ak@muc.de, davidm@hpl.hp.com, schwidefsky@de.ibm.com,
ralf@gnu.org, matthew@wil.cx
Subject: [PATCH][COMPAT] move struct flock32 1/8 generic
Date: Fri, 3 Jan 2003 16:41:06 +1100 [thread overview]
Message-ID: <20030103164106.21e65093.sfr@canb.auug.org.au> (raw)
Hi Linus,
This patch moves struct flock32 to struct compat_flock and consolidates
the functions used to copy it to/from user mode.
The overall diffstat looks like this:
arch/ia64/ia32/sys_ia32.c | 36 ++----------------------------------
arch/mips64/kernel/linux32.c | 37 ++-----------------------------------
arch/parisc/kernel/sys_parisc32.c | 37 ++-----------------------------------
arch/ppc64/kernel/sys_ppc32.c | 28 ++--------------------------
arch/s390x/kernel/linux32.c | 30 +++---------------------------
arch/s390x/kernel/linux32.h | 9 ---------
arch/sparc64/kernel/sys_sparc32.c | 28 ++--------------------------
arch/x86_64/ia32/sys_ia32.c | 28 ++--------------------------
fs/compat.c | 31 +++++++++++++++++++++++++++++++
include/asm-ia64/compat.h | 8 ++++++++
include/asm-ia64/ia32.h | 9 ---------
include/asm-mips64/compat.h | 9 +++++++++
include/asm-parisc/compat.h | 8 ++++++++
include/asm-ppc64/compat.h | 9 +++++++++
include/asm-ppc64/ppc32.h | 9 ---------
include/asm-s390x/compat.h | 9 +++++++++
include/asm-sparc64/compat.h | 9 +++++++++
include/asm-sparc64/fcntl.h | 13 -------------
include/asm-x86_64/compat.h | 8 ++++++++
include/asm-x86_64/ia32.h | 10 ----------
include/linux/compat.h | 3 +++
21 files changed, 109 insertions(+), 259 deletions(-)
This is just the generic part.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.54-200301031304-32bit.1/fs/compat.c 2.5.54-200301031304-32bit.2/fs/compat.c
--- 2.5.54-200301031304-32bit.1/fs/compat.c 2002-12-16 14:49:52.000000000 +1100
+++ 2.5.54-200301031304-32bit.2/fs/compat.c 2003-01-03 16:24:56.000000000 +1100
@@ -16,6 +16,7 @@
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/fs.h>
+#include <linux/fcntl.h>
#include <asm/uaccess.h>
@@ -70,3 +71,33 @@
error = cp_compat_stat(&stat, statbuf);
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;
+}
diff -ruN 2.5.54-200301031304-32bit.1/include/linux/compat.h 2.5.54-200301031304-32bit.2/include/linux/compat.h
--- 2.5.54-200301031304-32bit.1/include/linux/compat.h 2003-01-03 14:08:45.000000000 +1100
+++ 2.5.54-200301031304-32bit.2/include/linux/compat.h 2003-01-03 16:25:50.000000000 +1100
@@ -10,6 +10,7 @@
#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) \
@@ -33,6 +34,8 @@
};
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 *);
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
next reply other threads:[~2003-01-03 5:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-03 5:41 Stephen Rothwell [this message]
2003-01-03 5:55 ` [PATCH][COMPAT] move struct flock32 2/8 ppc64 Stephen Rothwell
2003-01-03 6:21 ` [PATCH][COMPAT] move struct flock32 3/8 sparc64 Stephen Rothwell
2003-01-04 2:56 ` David S. Miller
2003-01-04 6:18 ` Stephen Rothwell
2003-01-06 7:00 ` David S. Miller
2003-01-03 6:25 ` [PATCH][COMPAT] move struct flock32 4/8 x86_64 Stephen Rothwell
2003-01-03 6:28 ` [PATCH][COMPAT] move struct flock32 5/8 ia64 Stephen Rothwell
2003-01-03 6:35 ` [PATCH][COMPAT] move struct flock32 6/8 s390x Stephen Rothwell
2003-01-03 6:39 ` [PATCH][COMPAT] move struct flock32 7/8 mips64 Stephen Rothwell
2003-01-03 6:42 ` [PATCH][COMPAT] move struct flock32 8/8 parisc 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=20030103164106.21e65093.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=ak@muc.de \
--cc=anton@samba.org \
--cc=davem@redhat.com \
--cc=davidm@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=ralf@gnu.org \
--cc=schwidefsky@de.ibm.com \
--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
all inboxes | Powered by JetHome®