From mwm@mired.org  Fri Aug 18 14:33:39 2000
Return-Path: <mwm@mired.org>
Received: from guru.mired.org (zoom1-111.telepath.com [216.14.1.111])
	by hub.freebsd.org (Postfix) with SMTP id 0FC2237B422
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 18 Aug 2000 14:33:38 -0700 (PDT)
Received: (qmail 77723 invoked by uid 100); 18 Aug 2000 21:33:02 -0000
Message-Id: <20000818213302.77722.qmail@guru.mired.org>
Date: 18 Aug 2000 21:33:02 -0000
From: mwm@mired.org
Reply-To: mwm@mired.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: mount output is to long, and "mount -v" is useless.
X-Send-Pr-Version: 3.2

>Number:         20710
>Category:       bin
>Synopsis:       mount output is to long, and "mount -v" is useless.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sheldonh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 18 14:40:01 PDT 2000
>Closed-Date:    Tue Sep 5 05:08:15 PDT 2000
>Last-Modified:  Tue Sep 05 05:08:39 PDT 2000
>Originator:     Mike Meyer
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Missionaria Phonibalonica
>Environment:

	Most recent version of FreeBSD.

>Description:

	The "mount" command to get a list of mounted file systems now
	outputs lots of information, making the critical stuff - the
	actual mount points - hard to find.
	
	Also, the command "mount -v" and the command "mount" do the
	exact same thing. This seems like such a waste.

>How-To-Repeat:

	Run "mount" and notice the wrapped lines on an 80-column screen.
	Run "mount -v" and notice nearly identical output!

>Fix:

	The attached patch to sbin/mount/mount.c changes mount so that
	a bare "mount" just lists the mount points, and "mount -v"
	prints all the statistics.
	
	While it might be desirable to have "mount" print the options as well,
	having the non-verbose one be as quiet as possible while still
	being useful seemed like the right option.


--- mount.c-orig	Fri Aug 18 16:20:39 2000
+++ mount.c	Fri Aug 18 16:22:23 2000
@@ -81,7 +81,7 @@
 int	mountfs __P((const char *, const char *, const char *,
 			int, const char *, const char *));
 void	remopt __P((char *, const char *));
-void	prmount __P((struct statfs *));
+void	prmount __P((struct statfs *, int verbose));
 void	putfsent __P((const struct statfs *));
 void	usage __P((void));
 char   *flags2opts __P((int));
@@ -219,7 +219,7 @@
 				if (checkvfsname(mntbuf[i].f_fstypename,
 				    vfslist))
 					continue;
-				prmount(&mntbuf[i]);
+				prmount(&mntbuf[i], verbose);
 			}
 		}
 		exit(rval);
@@ -490,7 +490,7 @@
 			if (fstab_style)
 				putfsent(&sf);
 			else
-				prmount(&sf);
+				prmount(&sf, 1);
 		}
 		break;
 	}
@@ -499,15 +499,20 @@
 }
 
 void
-prmount(sfp)
+prmount(sfp, verbose)
 	struct statfs *sfp;
+	int verbose;
 {
 	int flags;
 	struct opt *o;
 	struct passwd *pw;
 
-	(void)printf("%s on %s (%s", sfp->f_mntfromname, sfp->f_mntonname,
-	    sfp->f_fstypename);
+	(void)printf("%s on %s", sfp->f_mntfromname, sfp->f_mntonname);
+	if (!verbose) {
+	  putchar('\n');
+	  return;
+	}
+	(void)printf(" (%s", sfp->f_fstypename);
 
 	flags = sfp->f_flags & MNT_VISFLAGMASK;
 	for (o = optnames; flags && o->o_opt; o++)



>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: mwm@mired.org
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/20710: mount output is to long, and "mount -v" is useless.
Date: Sun, 20 Aug 2000 05:34:13 +1000 (EST)

 On 18 Aug 2000 mwm@mired.org wrote:
 
 > >Description:
 > 
 > 	The "mount" command to get a list of mounted file systems now
 > 	outputs lots of information, making the critical stuff - the
 > 	actual mount points - hard to find.
 
 The stuff about reads and writes takes too much space and doesn't really
 belong in mount(8).
 
 > 	Also, the command "mount -v" and the command "mount" do the
 > 	exact same thing. This seems like such a waste.
 
 This is because mount with no args essentially applies -v.  -v only makes
 a difference for mounting a single filesystem.
 
 Bruce
 
 

From: Mike Meyer <mwm@mired.org>
To: Bruce Evans <bde@zeta.org.au>
Cc: mwm@mired.org, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/20710: mount output is to long, and "mount -v" is useless.
Date: Sat, 19 Aug 2000 16:34:56 -0500 (CDT)

 Bruce Evans writes:
 > On 18 Aug 2000 mwm@mired.org wrote:
 > > >Description:
 > > 
 > > 	The "mount" command to get a list of mounted file systems now
 > > 	outputs lots of information, making the critical stuff - the
 > > 	actual mount points - hard to find.
 > The stuff about reads and writes takes too much space and doesn't really
 > belong in mount(8).
 
 That's a reasonable way to look at things. I thought about patching it
 so that the options showed up without the -v, then decided not to. But
 where should you get that information from?
 
 > > 	Also, the command "mount -v" and the command "mount" do the
 > > 	exact same thing. This seems like such a waste.
 > This is because mount with no args essentially applies -v.  -v only makes
 > a difference for mounting a single filesystem.
 
 Um - not after you apply the patch I sent. That's was the point of
 using -v - it wasn't doing anything in that situation anyway.
 
 	<mike
 
 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: Bruce Evans <bde@zeta.org.au>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/20710: mount output is to long, and "mount -v" is useless. 
Date: Tue, 22 Aug 2000 17:17:19 +0200

 On Sat, 19 Aug 2000 12:40:03 MST, Bruce Evans wrote:
 
 >  > 	The "mount" command to get a list of mounted file systems now
 >  > 	outputs lots of information, making the critical stuff - the
 >  > 	actual mount points - hard to find.
 >  
 >  The stuff about reads and writes takes too much space and doesn't really
 >  belong in mount(8).
 >  
 >  > 	Also, the command "mount -v" and the command "mount" do the
 >  > 	exact same thing. This seems like such a waste.
 >  
 >  This is because mount with no args essentially applies -v.  -v only makes
 >  a difference for mounting a single filesystem.
 
 Hi Bruce,
 
 Could you suggest how we should go forward with this?  Your comments
 make it sound like you'd change _something_ about the status quo.
 
 Would you perhaps limit the printing of read and write information to
 verbose (-v) mode?
 
 Ciao,
 Sheldon.
 

From: Bruce Evans <bde@zeta.org.au>
To: Sheldon Hearn <sheldonh@uunet.co.za>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/20710: mount output is to long, and "mount -v" is useless.
Date: Wed, 23 Aug 2000 10:17:44 +1000 (EST)

 On Tue, 22 Aug 2000, Sheldon Hearn wrote:
 
 > Could you suggest how we should go forward with this?  Your comments
 > make it sound like you'd change _something_ about the status quo.
 > 
 > Would you perhaps limit the printing of read and write information to
 > verbose (-v) mode?
 
 I wouldn't change more than that.  `mount' with no args has shown the 
 mount options since the beginning of history.
 
 Bruce
 
 
Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Aug 23 02:56:33 PDT 2000 
Responsible-Changed-Why:  
I'll take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20710 
State-Changed-From-To: open->feedback 
State-Changed-By: sheldonh 
State-Changed-When: Wed Aug 23 02:59:46 PDT 2000 
State-Changed-Why:  
Mike, are you happy with rev 1.40 of mount.c ? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20710 
State-Changed-From-To: feedback->analyzed 
State-Changed-By: sheldonh 
State-Changed-When: Wed Aug 23 06:41:36 PDT 2000 
State-Changed-Why:  
Once we're happy that this breaks as little as we 
think it does in -CURRENT, we can merge it onto RELENG_4. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20710 
State-Changed-From-To: analyzed->closed 
State-Changed-By: sheldonh 
State-Changed-When: Tue Sep 5 05:08:15 PDT 2000 
State-Changed-Why:  
Merged onto RELENG_4 in rev 1.39.2.1. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20710 
>Unformatted:
