From owner-svn-src-stable-8@FreeBSD.ORG Wed May 18 01:14:27 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30961065675; Wed, 18 May 2011 01:14:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 957808FC12; Wed, 18 May 2011 01:14:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4I1ER5d054676; Wed, 18 May 2011 01:14:27 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4I1ERZK054673; Wed, 18 May 2011 01:14:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105180114.p4I1ERZK054673@svn.freebsd.org> From: Rick Macklem Date: Wed, 18 May 2011 01:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222044 - in stable/8/sys: fs/nfs nfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2011 01:14:27 -0000 Author: rmacklem Date: Wed May 18 01:14:27 2011 New Revision: 222044 URL: http://svn.freebsd.org/changeset/base/222044 Log: MFC: r221439 Add kernel support for NFSSVC_ZEROCLTSTATS and NFSSVC_ZEROSRVSTATS so that they can be used by nfsstat(1) to implement the "-z" option for the new NFS subsystem. Modified: stable/8/sys/fs/nfs/nfs_commonport.c stable/8/sys/nfs/nfssvc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonport.c Tue May 17 22:36:16 2011 (r222043) +++ stable/8/sys/fs/nfs/nfs_commonport.c Wed May 18 01:14:27 2011 (r222044) @@ -404,6 +404,64 @@ nfssvc_call(struct thread *p, struct nfs } else if (uap->flag & NFSSVC_GETSTATS) { error = copyout(&newnfsstats, CAST_USER_ADDR_T(uap->argp), sizeof (newnfsstats)); + if (error == 0) { + if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) { + newnfsstats.attrcache_hits = 0; + newnfsstats.attrcache_misses = 0; + newnfsstats.lookupcache_hits = 0; + newnfsstats.lookupcache_misses = 0; + newnfsstats.direofcache_hits = 0; + newnfsstats.direofcache_misses = 0; + newnfsstats.accesscache_hits = 0; + newnfsstats.accesscache_misses = 0; + newnfsstats.biocache_reads = 0; + newnfsstats.read_bios = 0; + newnfsstats.read_physios = 0; + newnfsstats.biocache_writes = 0; + newnfsstats.write_bios = 0; + newnfsstats.write_physios = 0; + newnfsstats.biocache_readlinks = 0; + newnfsstats.readlink_bios = 0; + newnfsstats.biocache_readdirs = 0; + newnfsstats.readdir_bios = 0; + newnfsstats.rpcretries = 0; + newnfsstats.rpcrequests = 0; + newnfsstats.rpctimeouts = 0; + newnfsstats.rpcunexpected = 0; + newnfsstats.rpcinvalid = 0; + bzero(newnfsstats.rpccnt, + sizeof(newnfsstats.rpccnt)); + } + if ((uap->flag & NFSSVC_ZEROSRVSTATS) != 0) { + newnfsstats.srvrpc_errs = 0; + newnfsstats.srv_errs = 0; + newnfsstats.srvcache_inproghits = 0; + newnfsstats.srvcache_idemdonehits = 0; + newnfsstats.srvcache_nonidemdonehits = 0; + newnfsstats.srvcache_misses = 0; + newnfsstats.srvcache_tcppeak = 0; + newnfsstats.srvcache_size = 0; + newnfsstats.srvclients = 0; + newnfsstats.srvopenowners = 0; + newnfsstats.srvopens = 0; + newnfsstats.srvlockowners = 0; + newnfsstats.srvlocks = 0; + newnfsstats.srvdelegates = 0; + newnfsstats.clopenowners = 0; + newnfsstats.clopens = 0; + newnfsstats.cllockowners = 0; + newnfsstats.cllocks = 0; + newnfsstats.cldelegates = 0; + newnfsstats.cllocalopenowners = 0; + newnfsstats.cllocalopens = 0; + newnfsstats.cllocallockowners = 0; + newnfsstats.cllocallocks = 0; + bzero(newnfsstats.srvrpccnt, + sizeof(newnfsstats.srvrpccnt)); + bzero(newnfsstats.cbrpccnt, + sizeof(newnfsstats.cbrpccnt)); + } + } return (error); } else if (uap->flag & NFSSVC_NFSUSERDPORT) { u_short sockport; Modified: stable/8/sys/nfs/nfssvc.h ============================================================================== --- stable/8/sys/nfs/nfssvc.h Tue May 17 22:36:16 2011 (r222043) +++ stable/8/sys/nfs/nfssvc.h Wed May 18 01:14:27 2011 (r222044) @@ -64,5 +64,7 @@ #define NFSSVC_CBADDSOCK 0x00200000 #define NFSSVC_GETSTATS 0x00400000 #define NFSSVC_BACKUPSTABLE 0x00800000 +#define NFSSVC_ZEROCLTSTATS 0x01000000 /* modifier for GETSTATS */ +#define NFSSVC_ZEROSRVSTATS 0x02000000 /* modifier for GETSTATS */ #endif /* _NFS_NFSSVC_H */