diff options
author | David Howells <dhowells@redhat.com> | 2006-06-23 05:02:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:42:45 -0400 |
commit | 726c334223180e3c0197cc980a432681370d4baf (patch) | |
tree | 8327b354bb3dc959a6606051ae6f8d4d035e38a2 /fs/freevxfs | |
parent | 454e2398be9b9fa30433fccc548db34d19aa9958 (diff) |
[PATCH] VFS: Permit filesystem to perform statfs with a known root dentry
Give the statfs superblock operation a dentry pointer rather than a superblock
pointer.
This complements the get_sb() patch. That reduced the significance of
sb->s_root, allowing NFS to place a fake root there. However, NFS does
require a dentry to use as a target for the statfs operation. This permits
the root in the vfsmount to be used instead.
linux/mount.h has been added where necessary to make allyesconfig build
successfully.
Interest has also been expressed for use with the FUSE and XFS filesystems.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Nathan Scott <nathans@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/freevxfs')
-rw-r--r-- | fs/freevxfs/vxfs_super.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c index d76eeaafbde2..b74b791fc23b 100644 --- a/fs/freevxfs/vxfs_super.c +++ b/fs/freevxfs/vxfs_super.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | #include <linux/stat.h> | 41 | #include <linux/stat.h> |
42 | #include <linux/vfs.h> | 42 | #include <linux/vfs.h> |
43 | #include <linux/mount.h> | ||
43 | 44 | ||
44 | #include "vxfs.h" | 45 | #include "vxfs.h" |
45 | #include "vxfs_extern.h" | 46 | #include "vxfs_extern.h" |
@@ -55,7 +56,7 @@ MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */ | |||
55 | 56 | ||
56 | 57 | ||
57 | static void vxfs_put_super(struct super_block *); | 58 | static void vxfs_put_super(struct super_block *); |
58 | static int vxfs_statfs(struct super_block *, struct kstatfs *); | 59 | static int vxfs_statfs(struct dentry *, struct kstatfs *); |
59 | static int vxfs_remount(struct super_block *, int *, char *); | 60 | static int vxfs_remount(struct super_block *, int *, char *); |
60 | 61 | ||
61 | static struct super_operations vxfs_super_ops = { | 62 | static struct super_operations vxfs_super_ops = { |
@@ -90,12 +91,12 @@ vxfs_put_super(struct super_block *sbp) | |||
90 | 91 | ||
91 | /** | 92 | /** |
92 | * vxfs_statfs - get filesystem information | 93 | * vxfs_statfs - get filesystem information |
93 | * @sbp: VFS superblock | 94 | * @dentry: VFS dentry to locate superblock |
94 | * @bufp: output buffer | 95 | * @bufp: output buffer |
95 | * | 96 | * |
96 | * Description: | 97 | * Description: |
97 | * vxfs_statfs fills the statfs buffer @bufp with information | 98 | * vxfs_statfs fills the statfs buffer @bufp with information |
98 | * about the filesystem described by @sbp. | 99 | * about the filesystem described by @dentry. |
99 | * | 100 | * |
100 | * Returns: | 101 | * Returns: |
101 | * Zero. | 102 | * Zero. |
@@ -107,12 +108,12 @@ vxfs_put_super(struct super_block *sbp) | |||
107 | * This is everything but complete... | 108 | * This is everything but complete... |
108 | */ | 109 | */ |
109 | static int | 110 | static int |
110 | vxfs_statfs(struct super_block *sbp, struct kstatfs *bufp) | 111 | vxfs_statfs(struct dentry *dentry, struct kstatfs *bufp) |
111 | { | 112 | { |
112 | struct vxfs_sb_info *infp = VXFS_SBI(sbp); | 113 | struct vxfs_sb_info *infp = VXFS_SBI(dentry->d_sb); |
113 | 114 | ||
114 | bufp->f_type = VXFS_SUPER_MAGIC; | 115 | bufp->f_type = VXFS_SUPER_MAGIC; |
115 | bufp->f_bsize = sbp->s_blocksize; | 116 | bufp->f_bsize = dentry->d_sb->s_blocksize; |
116 | bufp->f_blocks = infp->vsi_raw->vs_dsize; | 117 | bufp->f_blocks = infp->vsi_raw->vs_dsize; |
117 | bufp->f_bfree = infp->vsi_raw->vs_free; | 118 | bufp->f_bfree = infp->vsi_raw->vs_free; |
118 | bufp->f_bavail = 0; | 119 | bufp->f_bavail = 0; |