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 /arch/parisc | |
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 'arch/parisc')
-rw-r--r-- | arch/parisc/hpux/sys_hpux.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index 05273ccced0e..cb69727027ae 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
@@ -145,7 +145,7 @@ static int hpux_ustat(dev_t dev, struct hpux_ustat __user *ubuf) | |||
145 | s = user_get_super(dev); | 145 | s = user_get_super(dev); |
146 | if (s == NULL) | 146 | if (s == NULL) |
147 | goto out; | 147 | goto out; |
148 | err = vfs_statfs(s, &sbuf); | 148 | err = vfs_statfs(s->s_root, &sbuf); |
149 | drop_super(s); | 149 | drop_super(s); |
150 | if (err) | 150 | if (err) |
151 | goto out; | 151 | goto out; |
@@ -186,12 +186,12 @@ struct hpux_statfs { | |||
186 | int16_t f_pad; | 186 | int16_t f_pad; |
187 | }; | 187 | }; |
188 | 188 | ||
189 | static int vfs_statfs_hpux(struct super_block *sb, struct hpux_statfs *buf) | 189 | static int vfs_statfs_hpux(struct dentry *dentry, struct hpux_statfs *buf) |
190 | { | 190 | { |
191 | struct kstatfs st; | 191 | struct kstatfs st; |
192 | int retval; | 192 | int retval; |
193 | 193 | ||
194 | retval = vfs_statfs(sb, &st); | 194 | retval = vfs_statfs(dentry, &st); |
195 | if (retval) | 195 | if (retval) |
196 | return retval; | 196 | return retval; |
197 | 197 | ||
@@ -219,7 +219,7 @@ asmlinkage long hpux_statfs(const char __user *path, | |||
219 | error = user_path_walk(path, &nd); | 219 | error = user_path_walk(path, &nd); |
220 | if (!error) { | 220 | if (!error) { |
221 | struct hpux_statfs tmp; | 221 | struct hpux_statfs tmp; |
222 | error = vfs_statfs_hpux(nd.dentry->d_inode->i_sb, &tmp); | 222 | error = vfs_statfs_hpux(nd.dentry, &tmp); |
223 | if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) | 223 | if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) |
224 | error = -EFAULT; | 224 | error = -EFAULT; |
225 | path_release(&nd); | 225 | path_release(&nd); |
@@ -237,7 +237,7 @@ asmlinkage long hpux_fstatfs(unsigned int fd, struct hpux_statfs __user * buf) | |||
237 | file = fget(fd); | 237 | file = fget(fd); |
238 | if (!file) | 238 | if (!file) |
239 | goto out; | 239 | goto out; |
240 | error = vfs_statfs_hpux(file->f_dentry->d_inode->i_sb, &tmp); | 240 | error = vfs_statfs_hpux(file->f_dentry, &tmp); |
241 | if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) | 241 | if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) |
242 | error = -EFAULT; | 242 | error = -EFAULT; |
243 | fput(file); | 243 | fput(file); |