From owner-freebsd-bugs Mon Mar 23 13:31:10 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA13608 for freebsd-bugs-outgoing; Mon, 23 Mar 1998 13:31:10 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA13467; Mon, 23 Mar 1998 13:30:46 -0800 (PST) (envelope-from gnats) Received: from techunix.technion.ac.il (mellon@techunix.technion.ac.il [132.68.1.28]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA12141 for ; Mon, 23 Mar 1998 13:24:53 -0800 (PST) (envelope-from mellon@techunix.technion.ac.il) Received: (from mellon@localhost) by techunix.technion.ac.il (8.8.7/8.8.5) id AAA08158; Tue, 24 Mar 1998 00:24:08 +0300 (IDT) Message-Id: <19980324002407.01739@techunix.technion.ac.il> Date: Tue, 24 Mar 1998 00:24:07 +0300 From: Anatoly Vorobey To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/6114: Write statistics for ro mounts are silly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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