[PATCH 23/41] Populate the statfs structure associated to mount points for Hammer mounts

Francois Tigeot ftigeot at wolfpond.org
Mon Aug 15 05:42:23 PDT 2011


Contrary to most filesystems, Hammer didn't do it. The new code was taken
from ffs_mount()
---
 sys/vfs/hammer/hammer_vfsops.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/sys/vfs/hammer/hammer_vfsops.c b/sys/vfs/hammer/hammer_vfsops.c
index 4dfb470..fa9e04c 100644
--- a/sys/vfs/hammer/hammer_vfsops.c
+++ b/sys/vfs/hammer/hammer_vfsops.c
@@ -809,6 +809,18 @@ hammer_vfs_mount(struct mount *mp, char *mntpt, caddr_t data,
 		vflush(mp, 0, 0);
 
 done:
+	if ((mp->mnt_flag & MNT_UPDATE) == 0) {
+		/* New mount */
+
+		/* Populate info for mount point (NULL pad)*/
+		bzero(mp->mnt_stat.f_mntonname, MNAMELEN);
+		size_t size;
+		if (mntpt) {
+			copyinstr(mntpt, mp->mnt_stat.f_mntonname,
+										MNAMELEN -1, &size);
+		}
+	}
+	(void)VFS_STATFS(mp, &mp->mnt_stat, cred);
 	hammer_rel_volume(rootvol, 0);
 failed:
 	/*
-- 
1.7.5.4


--tThc/1wpZn/ma/RB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="0032-Run-VFS_START-for-the-root-mount-point.patch"





More information about the Submit mailing list