diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-05-04 13:50:37 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-05-04 13:50:37 +0000 |
commit | ab23d942ef14f09507ed0c4720b36db3a36c1545 (patch) | |
tree | e7752f43cd36ba864cf433f07e66872873322a5b /usr.bin | |
parent | 109912f8c759bb1aff80672847bb78ce95e0de85 (diff) | |
download | FreeBSD-src-ab23d942ef14f09507ed0c4720b36db3a36c1545.zip FreeBSD-src-ab23d942ef14f09507ed0c4720b36db3a36c1545.tar.gz |
Fix nfsstat.c so that the "-z" option works for the new
NFS subsystem.
MFC after: 2 weeks
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/nfsstat/nfsstat.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index 81a2260..0c7bad8 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -160,10 +160,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, @@ -545,7 +542,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"); |