summaryrefslogtreecommitdiff
path: root/sys/msdosfs/msdosfs_vfsops.c
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/msdosfs/msdosfs_vfsops.c
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/msdosfs/msdosfs_vfsops.c')
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index a6d60f52b9c..1609246478d 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.76 2016/03/27 11:39:37 bluhm Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.77 2016/04/26 18:37:03 natano Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
@@ -252,6 +252,11 @@ msdosfs_mount(struct mount *mp, const char *path, void *data,
}
}
+ if (pmp->pm_flags & MSDOSFSMNT_LONGNAME)
+ mp->mnt_stat.f_namemax = WIN_MAXLEN;
+ else
+ mp->mnt_stat.f_namemax = 12;
+
bzero(mp->mnt_stat.f_mntonname, MNAMELEN);
strlcpy(mp->mnt_stat.f_mntonname, path, MNAMELEN);
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
@@ -667,14 +672,9 @@ msdosfs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
sbp->f_bfree = pmp->pm_freeclustercount;
sbp->f_bavail = pmp->pm_freeclustercount;
sbp->f_files = pmp->pm_RootDirEnts; /* XXX */
- sbp->f_ffree = 0; /* what to put in here? */
- if (sbp != &mp->mnt_stat) {
- bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
- bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
- bcopy(&mp->mnt_stat.mount_info.msdosfs_args,
- &sbp->mount_info.msdosfs_args, sizeof(struct msdosfs_args));
- }
- strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
+ sbp->f_ffree = sbp->f_favail = 0; /* what to put in here? */
+ copy_statfs_info(sbp, mp);
+
return (0);
}