aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-06-23 05:02:58 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:42:45 -0400
commit726c334223180e3c0197cc980a432681370d4baf (patch)
tree8327b354bb3dc959a6606051ae6f8d4d035e38a2 /fs/ocfs2/super.c
parent454e2398be9b9fa30433fccc548db34d19aa9958 (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/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 788b8b50dc4c..cdf73393f094 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -100,7 +100,7 @@ static int ocfs2_initialize_mem_caches(void);
100static void ocfs2_free_mem_caches(void); 100static void ocfs2_free_mem_caches(void);
101static void ocfs2_delete_osb(struct ocfs2_super *osb); 101static void ocfs2_delete_osb(struct ocfs2_super *osb);
102 102
103static int ocfs2_statfs(struct super_block *sb, struct kstatfs *buf); 103static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf);
104 104
105static int ocfs2_sync_fs(struct super_block *sb, int wait); 105static int ocfs2_sync_fs(struct super_block *sb, int wait);
106 106
@@ -857,7 +857,7 @@ static void ocfs2_put_super(struct super_block *sb)
857 mlog_exit_void(); 857 mlog_exit_void();
858} 858}
859 859
860static int ocfs2_statfs(struct super_block *sb, struct kstatfs *buf) 860static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
861{ 861{
862 struct ocfs2_super *osb; 862 struct ocfs2_super *osb;
863 u32 numbits, freebits; 863 u32 numbits, freebits;
@@ -866,9 +866,9 @@ static int ocfs2_statfs(struct super_block *sb, struct kstatfs *buf)
866 struct buffer_head *bh = NULL; 866 struct buffer_head *bh = NULL;
867 struct inode *inode = NULL; 867 struct inode *inode = NULL;
868 868
869 mlog_entry("(%p, %p)\n", sb, buf); 869 mlog_entry("(%p, %p)\n", dentry->d_sb, buf);
870 870
871 osb = OCFS2_SB(sb); 871 osb = OCFS2_SB(dentry->d_sb);
872 872
873 inode = ocfs2_get_system_file_inode(osb, 873 inode = ocfs2_get_system_file_inode(osb,
874 GLOBAL_BITMAP_SYSTEM_INODE, 874 GLOBAL_BITMAP_SYSTEM_INODE,
@@ -891,7 +891,7 @@ static int ocfs2_statfs(struct super_block *sb, struct kstatfs *buf)
891 freebits = numbits - le32_to_cpu(bm_lock->id1.bitmap1.i_used); 891 freebits = numbits - le32_to_cpu(bm_lock->id1.bitmap1.i_used);
892 892
893 buf->f_type = OCFS2_SUPER_MAGIC; 893 buf->f_type = OCFS2_SUPER_MAGIC;
894 buf->f_bsize = sb->s_blocksize; 894 buf->f_bsize = dentry->d_sb->s_blocksize;
895 buf->f_namelen = OCFS2_MAX_FILENAME_LEN; 895 buf->f_namelen = OCFS2_MAX_FILENAME_LEN;
896 buf->f_blocks = ((sector_t) numbits) * 896 buf->f_blocks = ((sector_t) numbits) *
897 (osb->s_clustersize >> osb->sb->s_blocksize_bits); 897 (osb->s_clustersize >> osb->sb->s_blocksize_bits);