svn commit: r337437 - head/sbin/mount
Kirk McKusick
mckusick at FreeBSD.org
Tue Aug 7 21:17:46 UTC 2018
Author: mckusick
Date: Tue Aug 7 21:17:45 2018
New Revision: 337437
URL: https://svnweb.freebsd.org/changeset/base/337437
Log:
When getting mount information for all filesystems, mount uses the
getfsstat(2) system call using the MNT_NOWAIT flag to indicate that
it wants to use the statfs information cached in the mount structure.
When the -v (verbose) flag is specified, we need to use the MNT_WAIT
flag to getfsstat(2) so that kernel will call VFS_STATFS to get the
current statfs statistics from each filesystem.
Sponsored by: Netflix
Modified:
head/sbin/mount/mount.c
Modified: head/sbin/mount/mount.c
==============================================================================
--- head/sbin/mount/mount.c Tue Aug 7 20:43:50 2018 (r337436)
+++ head/sbin/mount/mount.c Tue Aug 7 21:17:45 2018 (r337437)
@@ -329,7 +329,8 @@ main(int argc, char *argv[])
rval = 0;
switch (argc) {
case 0:
- if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0)
+ if ((mntsize = getmntinfo(&mntbuf,
+ verbose ? MNT_WAIT : MNT_NOWAIT)) == 0)
err(1, "getmntinfo");
if (all) {
while ((fs = getfsent()) != NULL) {
More information about the svn-src-head
mailing list