summaryrefslogtreecommitdiff
path: root/sys/ufs/ext2fs
diff options
context:
space:
mode:
authorMartin Natano <natano@cvs.openbsd.org>2016-04-26 18:37:04 +0000
committerMartin Natano <natano@cvs.openbsd.org>2016-04-26 18:37:04 +0000
commit18f6501c55bc83667236bdf5b6304695efc88c43 (patch)
tree88fe91e506fc68cd25aca5438b86c7442e70cc67 /sys/ufs/ext2fs
parentb1b222c5bcc2d7e28a69311fd120253159c38ab6 (diff)
Populate all necessary statfs members in .vfs_statfs. cd9660, udf,
msdosfs and nfsv2 don't set f_namemax. ntfs and ext2fs don't set f_namemeax and f_favail. fusefs doesn't set f_mntfromspec, f_favail and f_iosize. Also, make all filesystems use copy_statfs_info(), so that all statfs information is filled in correctly for the (sb != &mp->mnt-stat) case. ok stefan
Diffstat (limited to 'sys/ufs/ext2fs')
-rw-r--r--sys/ufs/ext2fs/ext2fs_vfsops.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c
index c6c6167f3fc..aa2ef069ac2 100644
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vfsops.c,v 1.89 2016/03/27 11:39:37 bluhm Exp $ */
+/* $OpenBSD: ext2fs_vfsops.c,v 1.90 2016/04/26 18:37:03 natano Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */
/*
@@ -293,6 +293,7 @@ ext2fs_mount(struct mount *mp, const char *path, void *data,
strlcpy(mp->mnt_stat.f_mntfromname, fname, MNAMELEN);
memset(mp->mnt_stat.f_mntfromspec, 0, MNAMELEN);
strlcpy(mp->mnt_stat.f_mntfromspec, fspec, MNAMELEN);
+ memcpy(&mp->mnt_stat.mount_info.ufs_args, &args, sizeof(args));
if (fs->e2fs_fmod != 0) { /* XXX */
fs->e2fs_fmod = 0;
@@ -583,6 +584,7 @@ ext2fs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p)
mp->mnt_data = (qaddr_t)ump;
mp->mnt_stat.f_fsid.val[0] = (long)dev;
mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
+ mp->mnt_stat.f_namemax = MAXNAMLEN;
mp->mnt_flag |= MNT_LOCAL;
ump->um_mountp = mp;
ump->um_dev = dev;
@@ -711,13 +713,9 @@ ext2fs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
sbp->f_bfree = fs->e2fs.e2fs_fbcount;
sbp->f_bavail = sbp->f_bfree - fs->e2fs.e2fs_rbcount;
sbp->f_files = fs->e2fs.e2fs_icount;
- sbp->f_ffree = fs->e2fs.e2fs_ficount;
- if (sbp != &mp->mnt_stat) {
- memcpy(sbp->f_mntonname, mp->mnt_stat.f_mntonname, MNAMELEN);
- memcpy(sbp->f_mntfromname, mp->mnt_stat.f_mntfromname, MNAMELEN);
- memcpy(sbp->f_mntfromspec, mp->mnt_stat.f_mntfromspec, MNAMELEN);
- }
- strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
+ sbp->f_favail = sbp->f_ffree = fs->e2fs.e2fs_ficount;
+ copy_statfs_info(sbp, mp);
+
return (0);
}