Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Mar 1998 00:24:07 +0300
From:      Anatoly Vorobey <mellon@pobox.com>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/6114: Write statistics for ro mounts are silly
Message-ID:  <19980324002407.01739@techunix.technion.ac.il>

next in thread | raw e-mail | index | archive | help

>Number:         6114
>Category:       bin
>Synopsis:       Write statistics for ro mounts are silly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 23 13:30:16 PST 1998
>Last-Modified:
>Originator:     Anatoly Vorobey
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

	

>Description:

In mount.c, printing "writes: %d async: %d" is silly and 
meaningless for ro mounts. IMHO, better to either change it to
"writes: none" (patch below), or to eliminate "writes: " at all.

>How-To-Repeat:

>Fix:

Index: ./sbin/mount/mount.c
===================================================================
RCS file: /src/CVS/src/sbin/mount/mount.c,v
retrieving revision 1.23
diff -u -r1.23 mount.c
--- mount.c	1998/03/08 09:56:02	1.23
+++ mount.c	1998/03/24 00:08:35
@@ -480,10 +480,12 @@
 	struct opt *o;
 	struct passwd *pw;
 	int f;
+        int rdonly;
 
 	(void)printf("%s on %s", sfp->f_mntfromname, sfp->f_mntonname);
 
 	flags = sfp->f_flags & MNT_VISFLAGMASK;
+        rdonly = flags & MNT_RDONLY;
 	for (f = 0, o = optnames; flags && o->o_opt; o++)
 		if (flags & o->o_opt) {
 			(void)printf("%s%s", !f++ ? " (" : ", ", o->o_name);
@@ -496,8 +498,12 @@
 		else
 			(void)printf("%d", sfp->f_owner);
 	}
-	(void)printf("%swrites: sync %d async %d)\n", !f++ ? " (" : ", ",
-	    sfp->f_syncwrites, sfp->f_asyncwrites);
+        if(!rdonly)
+		(void)printf("%swrites: sync %d async %d)\n", 
+                             !f++ ? " (" : ", ",
+	    	              sfp->f_syncwrites, sfp->f_asyncwrites);
+        else
+		(void)printf("%swrites: none)\n", !f++ ? " (" : ", ");
 }
 
 struct statfs *



-- 
Anatoly Vorobey,
mellon@pobox.com http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980324002407.01739>