From: Linus Torvalds <torvalds@linux-foundation.org>
To: Brad Boyer <flar@allandria.com>
Cc: "J. R. Okajima" <hooanon05@yahoo.co.jp>,
Christoph Hellwig <hch@infradead.org>,
Nick Piggin <npiggin@suse.de>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Al Viro <viro@zeniv.linux.org.uk>,
Ulrich Drepper <drepper@redhat.com>
Subject: Re: [rfc] new stat*fs-like syscall?
Date: Tue, 6 Jul 2010 09:45:26 -0700 [thread overview]
Message-ID: <AANLkTikoD1OPjVcyvAAJ0QO6dGJxv40Np6LgRQ7X4tMM@mail.gmail.com> (raw)
In-Reply-To: <20100706004550.GC12517@cynthia.pants.nu>
[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]
On Mon, Jul 5, 2010 at 5:45 PM, Brad Boyer <flar@allandria.com> wrote:
> On Tue, Jul 06, 2010 at 08:31:30AM +0900, J. R. Okajima wrote:
>> For negative dentry, it should be supported as long as some
>> standard/specification doesn't prohibit explicitly. So I still think
>> statfs is the best place to implement _PC_LINK_MAX.
>
> If we're going to be changing statfs (or adding a new system call)
> anyway, that does seem like a reasonable place to export this data
> along with whatever else gets added. With the various things that
> have been suggested, maybe we need something more like the stat
> replacement that has been getting discussed with the room for some
> larger optional fields and a way to request a specific set of fields.
Let's not overdesign things. Just do something like the attached
patch, which is the obvious and straightforward thing to do.
Overdesigning is a disease. It's fundamentally wrong.
(Yeah, yeah,. the patch is untested, and doesn't actually _fill_ the
new f_flags value, but that's left as a trivial exercise for the
reader.)
Linus
[-- Attachment #2: diff --]
[-- Type: application/octet-stream, Size: 5204 bytes --]
arch/ia64/include/asm/compat.h | 3 ++-
arch/mips/include/asm/statfs.h | 12 ++++++++----
arch/s390/include/asm/statfs.h | 9 ++++++---
arch/x86/include/asm/compat.h | 3 ++-
fs/compat.c | 5 +++--
include/asm-generic/statfs.h | 9 ++++++---
include/linux/statfs.h | 3 ++-
7 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/arch/ia64/include/asm/compat.h b/arch/ia64/include/asm/compat.h
index f90edc8..ab15469 100644
--- a/arch/ia64/include/asm/compat.h
+++ b/arch/ia64/include/asm/compat.h
@@ -105,7 +105,8 @@ struct compat_statfs {
compat_fsid_t f_fsid;
int f_namelen; /* SunOS ignores this field. */
int f_frsize;
- int f_spare[5];
+ int f_flags;
+ int f_spare[4];
};
#define COMPAT_RLIM_OLD_INFINITY 0x7fffffff
diff --git a/arch/mips/include/asm/statfs.h b/arch/mips/include/asm/statfs.h
index c3ddf97..0f805c7 100644
--- a/arch/mips/include/asm/statfs.h
+++ b/arch/mips/include/asm/statfs.h
@@ -33,7 +33,8 @@ struct statfs {
/* Linux specials */
__kernel_fsid_t f_fsid;
long f_namelen;
- long f_spare[6];
+ long f_flags;
+ long f_spare[5];
};
#if (_MIPS_SIM == _MIPS_SIM_ABI32) || (_MIPS_SIM == _MIPS_SIM_NABI32)
@@ -53,7 +54,8 @@ struct statfs64 {
__u64 f_bavail;
__kernel_fsid_t f_fsid;
__u32 f_namelen;
- __u32 f_spare[6];
+ __u32 f_flags;
+ __u32 f_spare[5];
};
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
@@ -73,7 +75,8 @@ struct statfs64 { /* Same as struct statfs */
/* Linux specials */
__kernel_fsid_t f_fsid;
long f_namelen;
- long f_spare[6];
+ long f_flags;
+ long f_spare[5];
};
struct compat_statfs64 {
@@ -88,7 +91,8 @@ struct compat_statfs64 {
__u64 f_bavail;
__kernel_fsid_t f_fsid;
__u32 f_namelen;
- __u32 f_spare[6];
+ __u32 f_flags;
+ __u32 f_spare[5];
};
#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
diff --git a/arch/s390/include/asm/statfs.h b/arch/s390/include/asm/statfs.h
index 06cc703..3be7fbd 100644
--- a/arch/s390/include/asm/statfs.h
+++ b/arch/s390/include/asm/statfs.h
@@ -33,7 +33,8 @@ struct statfs {
__kernel_fsid_t f_fsid;
int f_namelen;
int f_frsize;
- int f_spare[5];
+ int f_flags;
+ int f_spare[4];
};
struct statfs64 {
@@ -47,7 +48,8 @@ struct statfs64 {
__kernel_fsid_t f_fsid;
int f_namelen;
int f_frsize;
- int f_spare[5];
+ int f_flags;
+ int f_spare[4];
};
struct compat_statfs64 {
@@ -61,7 +63,8 @@ struct compat_statfs64 {
__kernel_fsid_t f_fsid;
__u32 f_namelen;
__u32 f_frsize;
- __u32 f_spare[5];
+ __u32 f_flags;
+ __u32 f_spare[4];
};
#endif /* __s390x__ */
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index 306160e..9f9cdb8 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -108,7 +108,8 @@ struct compat_statfs {
compat_fsid_t f_fsid;
int f_namelen; /* SunOS ignores this field. */
int f_frsize;
- int f_spare[5];
+ int f_flags;
+ int f_spare[4];
};
#define COMPAT_RLIM_OLD_INFINITY 0x7fffffff
diff --git a/fs/compat.c b/fs/compat.c
index 6490d21..fe96e7d 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -245,7 +245,7 @@ static int put_compat_statfs(struct compat_statfs __user *ubuf, struct kstatfs *
__put_user(kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]) ||
__put_user(kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]) ||
__put_user(kbuf->f_frsize, &ubuf->f_frsize) ||
- __put_user(0, &ubuf->f_spare[0]) ||
+ __put_user(kbuf->f_flags, &ubuf->f_flags) ||
__put_user(0, &ubuf->f_spare[1]) ||
__put_user(0, &ubuf->f_spare[2]) ||
__put_user(0, &ubuf->f_spare[3]) ||
@@ -318,7 +318,8 @@ static int put_compat_statfs64(struct compat_statfs64 __user *ubuf, struct kstat
__put_user(kbuf->f_namelen, &ubuf->f_namelen) ||
__put_user(kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]) ||
__put_user(kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]) ||
- __put_user(kbuf->f_frsize, &ubuf->f_frsize))
+ __put_user(kbuf->f_frsize, &ubuf->f_frsize) ||
+ __put_user(kbuf->f_flags, &ubuf->f_flags))
return -EFAULT;
return 0;
}
diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h
index 3b4fb3e..0fd28e0 100644
--- a/include/asm-generic/statfs.h
+++ b/include/asm-generic/statfs.h
@@ -33,7 +33,8 @@ struct statfs {
__kernel_fsid_t f_fsid;
__statfs_word f_namelen;
__statfs_word f_frsize;
- __statfs_word f_spare[5];
+ __statfs_word f_flags;
+ __statfs_word f_spare[4];
};
/*
@@ -55,7 +56,8 @@ struct statfs64 {
__kernel_fsid_t f_fsid;
__statfs_word f_namelen;
__statfs_word f_frsize;
- __statfs_word f_spare[5];
+ __statfs_word f_flags;
+ __statfs_word f_spare[4];
} ARCH_PACK_STATFS64;
/*
@@ -77,7 +79,8 @@ struct compat_statfs64 {
__kernel_fsid_t f_fsid;
__u32 f_namelen;
__u32 f_frsize;
- __u32 f_spare[5];
+ __u32 f_flags;
+ __u32 f_spare[4];
} ARCH_PACK_COMPAT_STATFS64;
#endif
diff --git a/include/linux/statfs.h b/include/linux/statfs.h
index b34cc82..dd8b4e7 100644
--- a/include/linux/statfs.h
+++ b/include/linux/statfs.h
@@ -16,7 +16,8 @@ struct kstatfs {
__kernel_fsid_t f_fsid;
long f_namelen;
long f_frsize;
- long f_spare[5];
+ long f_flags;
+ long f_spare[4];
};
#endif
next prev parent reply other threads:[~2010-07-06 16:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-24 13:14 [rfc] new stat*fs-like syscall? Nick Piggin
2010-06-24 14:03 ` Miklos Szeredi
2010-06-24 14:36 ` Nick Piggin
2010-06-24 14:08 ` Andy Lutomirski
2010-06-24 14:18 ` Miklos Szeredi
2010-06-24 14:37 ` Andrew Lutomirski
2010-06-24 14:48 ` Miklos Szeredi
2010-06-25 3:50 ` Nick Piggin
2010-06-24 23:06 ` Andreas Dilger
2010-06-25 6:37 ` Christoph Hellwig
2010-06-24 23:13 ` Andreas Dilger
2010-06-25 4:01 ` Nick Piggin
2010-06-25 4:33 ` Jeff Garzik
2010-06-25 17:47 ` Andreas Dilger
2010-06-25 17:52 ` Ulrich Drepper
2010-06-25 18:16 ` Christoph Hellwig
2010-06-25 18:45 ` Christoph Hellwig
2010-06-25 19:40 ` Ulrich Drepper
2010-06-25 19:40 ` Ulrich Drepper
2010-06-26 5:53 ` J. R. Okajima
2010-06-26 9:35 ` Christoph Hellwig
2010-06-26 12:54 ` J. R. Okajima
2010-07-05 20:58 ` Brad Boyer
2010-07-05 23:31 ` J. R. Okajima
2010-07-06 0:45 ` Brad Boyer
2010-07-06 16:45 ` Linus Torvalds [this message]
2010-07-07 1:44 ` Christoph Hellwig
2010-07-07 2:28 ` Linus Torvalds
2010-06-26 14:49 ` Ulrich Drepper
2010-06-26 10:13 ` Andi Kleen
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=AANLkTikoD1OPjVcyvAAJ0QO6dGJxv40Np6LgRQ7X4tMM@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=drepper@redhat.com \
--cc=flar@allandria.com \
--cc=hch@infradead.org \
--cc=hooanon05@yahoo.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.