Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2011 01:26:08 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r222045 - stable/8/usr.bin/nfsstat
Message-ID:  <201105180126.p4I1Q8UT055058@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Wed May 18 01:26:08 2011
New Revision: 222045
URL: http://svn.freebsd.org/changeset/base/222045

Log:
  MFC: r221440
  Fix nfsstat.c so that the "-z" option works for the new
  NFS subsystem.

Modified:
  stable/8/usr.bin/nfsstat/nfsstat.c
Directory Properties:
  stable/8/usr.bin/nfsstat/   (props changed)

Modified: stable/8/usr.bin/nfsstat/nfsstat.c
==============================================================================
--- stable/8/usr.bin/nfsstat/nfsstat.c	Wed May 18 01:14:27 2011	(r222044)
+++ stable/8/usr.bin/nfsstat/nfsstat.c	Wed May 18 01:26:08 2011	(r222045)
@@ -164,10 +164,7 @@ main(int argc, char **argv)
 	if (run_v4 != 0 && modfind("nfscommon") < 0)
 		errx(1, "experimental client/server not loaded");
 
-	if (run_v4 != 0) {
-		if (nfssvc(NFSSVC_GETSTATS, &ext_nfsstats) < 0)
-			err(1, "Can't get stats");
-	} else if (nlistf != NULL || memf != NULL) {
+	if (run_v4 == 0 && (nlistf != NULL || memf != NULL)) {
 		deadkernel = 1;
 
 		if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY,
@@ -549,7 +546,17 @@ sperc2(int ttl, int misses)
 void
 exp_intpr(int clientOnly, int serverOnly)
 {
+	int nfssvc_flag;
 
+	nfssvc_flag = NFSSVC_GETSTATS;
+	if (zflag != 0) {
+		if (clientOnly != 0)
+			nfssvc_flag |= NFSSVC_ZEROCLTSTATS;
+		if (serverOnly != 0)
+			nfssvc_flag |= NFSSVC_ZEROSRVSTATS;
+	}
+	if (nfssvc(nfssvc_flag, &ext_nfsstats) < 0)
+		err(1, "Can't get stats");
 	if (clientOnly != 0) {
 		if (printtitle) {
 			printf("Client Info:\n");



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