mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: matthew@wil.cx
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [PATCH][COMPAT] compat_sys_[f]statfs - parisc part
Date: Mon, 13 Jan 2003 16:28:47 +1100	[thread overview]
Message-ID: <20030113162847.53de7ca3.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20030113160923.603d4f72.sfr@canb.auug.org.au>

Hi Willy,

Here is the parisc part. This is relative to 2.5.56 and the previous
patches I have sent you.

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

diff -ruN 2.5.56-32bit.3/arch/parisc/kernel/sys_parisc32.c 2.5.56-32bit.4/arch/parisc/kernel/sys_parisc32.c
--- 2.5.56-32bit.3/arch/parisc/kernel/sys_parisc32.c	2003-01-13 11:03:51.000000000 +1100
+++ 2.5.56-32bit.4/arch/parisc/kernel/sys_parisc32.c	2003-01-13 11:07:06.000000000 +1100
@@ -315,74 +315,6 @@
     return -ENOSYS;
 }
 
-/* 32-bit user apps use struct statfs which uses 'long's */
-struct statfs32 {
-	__s32 f_type;
-	__s32 f_bsize;
-	__s32 f_blocks;
-	__s32 f_bfree;
-	__s32 f_bavail;
-	__s32 f_files;
-	__s32 f_ffree;
-	__kernel_fsid_t f_fsid;
-	__s32 f_namelen;
-	__s32 f_spare[6];
-};
-
-/* convert statfs struct to statfs32 struct and copy result to user */
-static unsigned long statfs32_to_user(struct statfs32 *ust32, struct statfs *st)
-{
-    struct statfs32 st32;
-#undef CP
-#define CP(a) st32.a = st->a
-    CP(f_type);
-    CP(f_bsize);
-    CP(f_blocks);
-    CP(f_bfree);
-    CP(f_bavail);
-    CP(f_files);
-    CP(f_ffree);
-    CP(f_fsid);
-    CP(f_namelen);
-    return copy_to_user(ust32, &st32, sizeof st32);
-}
-
-/* The following statfs calls are copies of code from linux/fs/open.c and
- * should be checked against those from time to time */
-asmlinkage long sys32_statfs(const char * path, struct statfs32 * buf)
-{
-	struct nameidata nd;
-	int error;
-
-	error = user_path_walk(path, &nd);
-	if (!error) {
-		struct statfs tmp;
-		error = vfs_statfs(nd.dentry->d_inode->i_sb, &tmp);
-		if (!error && statfs32_to_user(buf, &tmp))
-			error = -EFAULT;
-		path_release(&nd);
-	}
-	return error;
-}
-
-asmlinkage long sys32_fstatfs(unsigned int fd, struct statfs32 * buf)
-{
-	struct file * file;
-	struct statfs tmp;
-	int error;
-
-	error = -EBADF;
-	file = fget(fd);
-	if (!file)
-		goto out;
-	error = vfs_statfs(file->f_dentry->d_inode->i_sb, &tmp);
-	if (!error && statfs32_to_user(buf, &tmp))
-		error = -EFAULT;
-	fput(file);
-out:
-	return error;
-}
-
 /* These may not work without my local types changes, but I wanted the
  * code available in case it's useful to others. -PB
  */
diff -ruN 2.5.56-32bit.3/include/asm-parisc/compat.h 2.5.56-32bit.4/include/asm-parisc/compat.h
--- 2.5.56-32bit.3/include/asm-parisc/compat.h	2003-01-13 11:03:18.000000000 +1100
+++ 2.5.56-32bit.4/include/asm-parisc/compat.h	2003-01-13 11:07:06.000000000 +1100
@@ -72,4 +72,17 @@
 	compat_pid_t	l_pid;
 };
 
+struct compat_statfs {
+	s32		f_type;
+	s32		f_bsize;
+	s32		f_blocks;
+	s32		f_bfree;
+	s32		f_bavail;
+	s32		f_files;
+	s32		f_ffree;
+	__kernel_fsid_t	f_fsid;
+	s32		f_namelen;
+	s32		f_spare[6];
+};
+
 #endif /* _ASM_PARISC_COMPAT_H */

      parent reply	other threads:[~2003-01-13  5:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-13  5:09 [PATCH][COMPAT] compat_sys_[f]statfs - generic part Stephen Rothwell
2003-01-13  5:12 ` [PATCH][COMPAT] compat_sys_[f]statfs - ppc64 part Stephen Rothwell
2003-01-13  5:19 ` [PATCH][COMPAT] compat_sys_[f]statfs - sparc64 part Stephen Rothwell
2003-01-13  5:21 ` [PATCH][COMPAT] compat_sys_[f]statfs - x86_64 part Stephen Rothwell
2003-01-13  5:23 ` [PATCH][COMPAT] compat_sys_[f]statfs - ia64 part Stephen Rothwell
2003-01-13  5:25 ` [PATCH][COMPAT] compat_sys_[f]statfs - s390x part Stephen Rothwell
2003-01-13  5:27 ` [PATCH][COMPAT] compat_sys_[f]statfs - mips64 part Stephen Rothwell
2003-01-13  5:28 ` Stephen Rothwell [this message]

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=20030113162847.53de7ca3.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --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®