From: Francois Tigeot Date: Mon, 15 Aug 2011 12:42:23 +0000 (+0200) Subject: HAMMER VFS: record the name of the mount directory X-Git-Tag: v3.0.0~407 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/98ad7ade4883ecc520b2ba2a356e71709f584cf4 HAMMER VFS: record the name of the mount directory * It has to be set at mount time in mp->mnt_stat.f_mntonname. * Contrary to most filesystems, Hammer didn't do it. * The new code was taken from ffs_mount() and OpenBSD's vfs_rootmountalloc() --- diff --git a/sys/vfs/hammer/hammer_vfsops.c b/sys/vfs/hammer/hammer_vfsops.c index 62a73c9..4b6103e 100644 --- a/sys/vfs/hammer/hammer_vfsops.c +++ b/sys/vfs/hammer/hammer_vfsops.c @@ -792,6 +792,20 @@ 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); + } else { /* Root mount */ + mp->mnt_stat.f_mntonname[0] = '/'; + } + } + (void)VFS_STATFS(mp, &mp->mnt_stat, cred); hammer_rel_volume(rootvol, 0); failed: /*