summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c13
-rw-r--r--sys/isofs/udf/udf_vfsops.c5
-rw-r--r--sys/miscfs/fuse/fuse_vfsops.c12
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c18
-rw-r--r--sys/nfs/nfs_vfsops.c15
-rw-r--r--sys/ntfs/ntfs_vfsops.c14
-rw-r--r--sys/ufs/ext2fs/ext2fs_vfsops.c14
-rw-r--r--sys/ufs/mfs/mfs_extern.h3
-rw-r--r--sys/ufs/mfs/mfs_vfsops.c20
9 files changed, 50 insertions, 64 deletions
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index 43f612f0418..95dd7169123 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660_vfsops.c,v 1.77 2016/03/27 11:39:37 bluhm Exp $ */
+/* $OpenBSD: cd9660_vfsops.c,v 1.78 2016/04/26 18:37:02 natano Exp $ */
/* $NetBSD: cd9660_vfsops.c,v 1.26 1997/06/13 15:38:58 pk Exp $ */
/*-
@@ -383,6 +383,7 @@ iso_mountfs(devvp, mp, p, argp)
mp->mnt_data = (qaddr_t)isomp;
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 = NAME_MAX;
mp->mnt_flag |= MNT_LOCAL;
isomp->im_mountp = mp;
isomp->im_dev = dev;
@@ -650,13 +651,9 @@ cd9660_statfs(mp, sbp, p)
sbp->f_bavail = 0; /* blocks free for non superuser */
sbp->f_files = 0; /* total files */
sbp->f_ffree = 0; /* free file nodes */
- 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.iso_args,
- &sbp->mount_info.iso_args, sizeof(struct iso_args));
- }
+ sbp->f_favail = 0; /* file nodes free for non superuser */
+ copy_statfs_info(sbp, mp);
+
return (0);
}
diff --git a/sys/isofs/udf/udf_vfsops.c b/sys/isofs/udf/udf_vfsops.c
index aad3ccf17fe..b56e53ff41c 100644
--- a/sys/isofs/udf/udf_vfsops.c
+++ b/sys/isofs/udf/udf_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udf_vfsops.c,v 1.49 2016/03/27 11:39:37 bluhm Exp $ */
+/* $OpenBSD: udf_vfsops.c,v 1.50 2016/04/26 18:37:02 natano Exp $ */
/*
* Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org>
@@ -264,6 +264,7 @@ udf_mountfs(struct vnode *devvp, struct mount *mp, uint32_t lb, struct proc *p)
mp->mnt_data = (qaddr_t) ump;
mp->mnt_stat.f_fsid.val[0] = devvp->v_rdev;
mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
+ mp->mnt_stat.f_namemax = NAME_MAX;
mp->mnt_flag |= MNT_LOCAL;
ump->um_mountp = mp;
@@ -542,6 +543,8 @@ udf_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
sbp->f_bavail = 0;
sbp->f_files = 0;
sbp->f_ffree = 0;
+ sbp->f_favail = 0;
+ copy_statfs_info(sbp, mp);
return (0);
}
diff --git a/sys/miscfs/fuse/fuse_vfsops.c b/sys/miscfs/fuse/fuse_vfsops.c
index 9f9541bbb5d..36584775d63 100644
--- a/sys/miscfs/fuse/fuse_vfsops.c
+++ b/sys/miscfs/fuse/fuse_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_vfsops.c,v 1.20 2016/03/27 11:39:37 bluhm Exp $ */
+/* $OpenBSD: fuse_vfsops.c,v 1.21 2016/04/26 18:37:02 natano Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -111,7 +111,9 @@ fusefs_mount(struct mount *mp, const char *path, void *data,
bzero(mp->mnt_stat.f_mntonname, MNAMELEN);
strlcpy(mp->mnt_stat.f_mntonname, path, MNAMELEN);
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
- bcopy("fusefs", mp->mnt_stat.f_mntfromname, sizeof("fusefs"));
+ strlcpy(mp->mnt_stat.f_mntfromname, "fusefs", MNAMELEN);
+ bzero(mp->mnt_stat.f_mntfromspec, MNAMELEN);
+ strlcpy(mp->mnt_stat.f_mntfromspec, "fusefs", MNAMELEN);
fuse_device_set_fmp(fmp, 1);
fbuf = fb_setup(0, 0, FBT_INIT, p);
@@ -204,6 +206,8 @@ fusefs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
fmp = VFSTOFUSEFS(mp);
+ copy_statfs_info(sbp, mp);
+
if (fmp->sess_init) {
fbuf = fb_setup(0, FUSE_ROOT_ID, FBT_STATFS, p);
@@ -219,7 +223,9 @@ fusefs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
sbp->f_blocks = fbuf->fb_stat.f_blocks;
sbp->f_files = fbuf->fb_stat.f_files;
sbp->f_ffree = fbuf->fb_stat.f_ffree;
+ sbp->f_favail = fbuf->fb_stat.f_favail;
sbp->f_bsize = fbuf->fb_stat.f_frsize;
+ sbp->f_iosize = fbuf->fb_stat.f_bsize;
sbp->f_namemax = fbuf->fb_stat.f_namemax;
fb_delete(fbuf);
} else {
@@ -227,8 +233,10 @@ fusefs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
sbp->f_bfree = 0;
sbp->f_blocks = 0;
sbp->f_ffree = 0;
+ sbp->f_favail = 0;
sbp->f_files = 0;
sbp->f_bsize = 0;
+ sbp->f_iosize = 0;
sbp->f_namemax = 0;
}
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);
}
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index 5fc858687c5..79eb8726b5a 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.108 2016/03/17 18:52:31 bluhm Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.109 2016/04/26 18:37:03 natano Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -152,7 +152,6 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
tquad = fxdr_hyper(&sfp->sf_ffiles);
sbp->f_ffree = tquad;
sbp->f_favail = tquad;
- sbp->f_namemax = MAXNAMLEN;
} else {
sbp->f_bsize = fxdr_unsigned(int32_t, sfp->sf_bsize);
sbp->f_blocks = fxdr_unsigned(int32_t, sfp->sf_blocks);
@@ -160,6 +159,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
sbp->f_bavail = fxdr_unsigned(int32_t, sfp->sf_bavail);
sbp->f_files = 0;
sbp->f_ffree = 0;
+ sbp->f_favail = 0;
}
copy_statfs_info(sbp, mp);
m_freem(info.nmi_mrep);
@@ -641,10 +641,13 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct mbuf *nam,
nmp->nm_acdirmin = NFS_MINATTRTIMO;
nmp->nm_acdirmax = NFS_MAXATTRTIMO;
bcopy(argp->fh, nmp->nm_fh, argp->fhsize);
- strncpy(&mp->mnt_stat.f_fstypename[0], mp->mnt_vfc->vfc_name, MFSNAMELEN);
- bcopy(pth, mp->mnt_stat.f_mntonname, MNAMELEN);
- bcopy(hst, mp->mnt_stat.f_mntfromname, MNAMELEN);
- bcopy(hst, mp->mnt_stat.f_mntfromspec, MNAMELEN);
+ mp->mnt_stat.f_namemax = MAXNAMLEN;
+ memset(mp->mnt_stat.f_mntonname, 0, MNAMELEN);
+ strlcpy(mp->mnt_stat.f_mntonname, pth, MNAMELEN);
+ memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN);
+ strlcpy(mp->mnt_stat.f_mntfromname, hst, MNAMELEN);
+ memset(mp->mnt_stat.f_mntfromspec, 0, MNAMELEN);
+ strlcpy(mp->mnt_stat.f_mntfromspec, hst, MNAMELEN);
bcopy(argp, &mp->mnt_stat.mount_info.nfs_args, sizeof(*argp));
nmp->nm_nam = nam;
nfs_decode_args(nmp, argp, &mp->mnt_stat.mount_info.nfs_args);
diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c
index 59b9128bc97..f78a99f4efd 100644
--- a/sys/ntfs/ntfs_vfsops.c
+++ b/sys/ntfs/ntfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vfsops.c,v 1.49 2016/03/27 11:39:37 bluhm Exp $ */
+/* $OpenBSD: ntfs_vfsops.c,v 1.50 2016/04/26 18:37:03 natano Exp $ */
/* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */
/*-
@@ -436,6 +436,7 @@ ntfs_mountfs(struct vnode *devvp, struct mount *mp, struct ntfs_args *argsp,
mp->mnt_stat.f_fsid.val[0] = dev;
mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
+ mp->mnt_stat.f_namemax = NTFS_MAXFILENAME;
mp->mnt_flag |= MNT_LOCAL;
devvp->v_specmountpoint = mp;
return (0);
@@ -609,17 +610,10 @@ ntfs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
sbp->f_iosize = ntmp->ntm_bps * ntmp->ntm_spc;
sbp->f_blocks = ntmp->ntm_bootfile.bf_spv;
sbp->f_bfree = sbp->f_bavail = ntfs_cntobn(ntmp->ntm_cfree);
- sbp->f_ffree = sbp->f_bfree / ntmp->ntm_bpmftrec;
+ sbp->f_ffree = sbp->f_favail = sbp->f_bfree / ntmp->ntm_bpmftrec;
sbp->f_files = mftallocated / ntfs_bntob(ntmp->ntm_bpmftrec) +
sbp->f_ffree;
- sbp->f_flags = mp->mnt_flag;
- 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.ntfs_args,
- &sbp->mount_info.ntfs_args, sizeof(struct ntfs_args));
- }
- strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
+ copy_statfs_info(sbp, mp);
return (0);
}
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);
}
diff --git a/sys/ufs/mfs/mfs_extern.h b/sys/ufs/mfs/mfs_extern.h
index 5af62fa15ee..67b2b4dae61 100644
--- a/sys/ufs/mfs/mfs_extern.h
+++ b/sys/ufs/mfs/mfs_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfs_extern.h,v 1.18 2010/12/21 20:14:44 thib Exp $ */
+/* $OpenBSD: mfs_extern.h,v 1.19 2016/04/26 18:37:03 natano Exp $ */
/* $NetBSD: mfs_extern.h,v 1.4 1996/02/09 22:31:27 christos Exp $ */
/*-
@@ -49,7 +49,6 @@ extern struct vops mfs_vops;
int mfs_mount(struct mount *, const char *, void *, struct nameidata *,
struct proc *);
int mfs_start(struct mount *, int, struct proc *);
-int mfs_statfs(struct mount *, struct statfs *, struct proc *);
int mfs_init(struct vfsconf *);
int mfs_checkexp(struct mount *, struct mbuf *, int *, struct ucred **);
diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c
index ac1af07603d..1db8b98269e 100644
--- a/sys/ufs/mfs/mfs_vfsops.c
+++ b/sys/ufs/mfs/mfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfs_vfsops.c,v 1.49 2016/03/14 23:08:06 krw Exp $ */
+/* $OpenBSD: mfs_vfsops.c,v 1.50 2016/04/26 18:37:03 natano Exp $ */
/* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */
/*
@@ -65,7 +65,7 @@ const struct vfsops mfs_vfsops = {
ffs_unmount,
ufs_root,
ufs_quotactl,
- mfs_statfs,
+ ffs_statfs,
ffs_sync,
ffs_vget,
ffs_fhtovp,
@@ -210,22 +210,6 @@ mfs_start(struct mount *mp, int flags, struct proc *p)
}
/*
- * Get file system statistics.
- */
-int
-mfs_statfs(struct mount *mp, struct statfs *sbp, struct proc *p)
-{
- int error;
-
- error = ffs_statfs(mp, sbp, p);
- strncpy(&sbp->f_fstypename[0], mp->mnt_vfc->vfc_name, MFSNAMELEN);
- if (sbp != &mp->mnt_stat)
- memcpy(&sbp->mount_info.mfs_args,
- &mp->mnt_stat.mount_info.mfs_args, sizeof(struct mfs_args));
- return (error);
-}
-
-/*
* check export permission, not supported
*/
/* ARGUSED */