[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>
This commit is contained in:

کامیت شده توسط
Linus Torvalds

والد
454e2398be
کامیت
726c334223
@@ -40,6 +40,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/stat.h>
|
||||
#include <linux/vfs.h>
|
||||
#include <linux/mount.h>
|
||||
|
||||
#include "vxfs.h"
|
||||
#include "vxfs_extern.h"
|
||||
@@ -55,7 +56,7 @@ MODULE_ALIAS("vxfs"); /* makes mount -t vxfs autoload the module */
|
||||
|
||||
|
||||
static void vxfs_put_super(struct super_block *);
|
||||
static int vxfs_statfs(struct super_block *, struct kstatfs *);
|
||||
static int vxfs_statfs(struct dentry *, struct kstatfs *);
|
||||
static int vxfs_remount(struct super_block *, int *, char *);
|
||||
|
||||
static struct super_operations vxfs_super_ops = {
|
||||
@@ -90,12 +91,12 @@ vxfs_put_super(struct super_block *sbp)
|
||||
|
||||
/**
|
||||
* vxfs_statfs - get filesystem information
|
||||
* @sbp: VFS superblock
|
||||
* @dentry: VFS dentry to locate superblock
|
||||
* @bufp: output buffer
|
||||
*
|
||||
* Description:
|
||||
* vxfs_statfs fills the statfs buffer @bufp with information
|
||||
* about the filesystem described by @sbp.
|
||||
* about the filesystem described by @dentry.
|
||||
*
|
||||
* Returns:
|
||||
* Zero.
|
||||
@@ -107,12 +108,12 @@ vxfs_put_super(struct super_block *sbp)
|
||||
* This is everything but complete...
|
||||
*/
|
||||
static int
|
||||
vxfs_statfs(struct super_block *sbp, struct kstatfs *bufp)
|
||||
vxfs_statfs(struct dentry *dentry, struct kstatfs *bufp)
|
||||
{
|
||||
struct vxfs_sb_info *infp = VXFS_SBI(sbp);
|
||||
struct vxfs_sb_info *infp = VXFS_SBI(dentry->d_sb);
|
||||
|
||||
bufp->f_type = VXFS_SUPER_MAGIC;
|
||||
bufp->f_bsize = sbp->s_blocksize;
|
||||
bufp->f_bsize = dentry->d_sb->s_blocksize;
|
||||
bufp->f_blocks = infp->vsi_raw->vs_dsize;
|
||||
bufp->f_bfree = infp->vsi_raw->vs_free;
|
||||
bufp->f_bavail = 0;
|
||||
|
مرجع در شماره جدید
Block a user