Author: rmacklem
Date: Mon Oct  3 23:17:57 2016
New Revision: 306663
URL: https://svnweb.freebsd.org/changeset/base/306663

Log:
  Revert r306659 since the userland changes won't merge and this would
  break the build.

Modified:
  stable/10/sys/fs/nfs/nfs_commonkrpc.c
  stable/10/sys/fs/nfs/nfs_commonport.c
  stable/10/sys/fs/nfs/nfsport.h
  stable/10/sys/fs/nfs/nfsproto.h
  stable/10/sys/fs/nfsclient/nfs_clbio.c
  stable/10/sys/fs/nfsclient/nfs_clcomsubs.c
  stable/10/sys/fs/nfsclient/nfs_clstate.c
  stable/10/sys/fs/nfsclient/nfs_clsubs.c
  stable/10/sys/fs/nfsclient/nfs_clvfsops.c
  stable/10/sys/fs/nfsclient/nfs_clvnops.c
  stable/10/sys/fs/nfsserver/nfs_nfsdcache.c
  stable/10/sys/fs/nfsserver/nfs_nfsdport.c
  stable/10/sys/fs/nfsserver/nfs_nfsdsocket.c
  stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- stable/10/sys/fs/nfs/nfs_commonkrpc.c       Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfs/nfs_commonkrpc.c       Mon Oct  3 23:17:57 2016        
(r306663)
@@ -90,7 +90,7 @@ uint32_t      nfscl_nfs4_done_probes[NFSV41_N
 NFSSTATESPINLOCK;
 NFSREQSPINLOCK;
 NFSDLOCKMUTEX;
-extern struct nfsstatsv1 nfsstatsv1;
+extern struct nfsstats newnfsstats;
 extern struct nfsreqhead nfsd_reqq;
 extern int nfscl_ticks;
 extern void (*ncl_call_invalcaches)(struct vnode *);
@@ -643,7 +643,7 @@ newnfs_request(struct nfsrv_descript *nd
                procnum = NFSV4PROC_COMPOUND;
 
        if (nmp != NULL) {
-               NFSINCRGLOBAL(nfsstatsv1.rpcrequests);
+               NFSINCRGLOBAL(newnfsstats.rpcrequests);
 
                /* Map the procnum to the old NFSv2 one, as required. */
                if ((nd->nd_flag & ND_NFSV2) != 0) {
@@ -763,18 +763,18 @@ tryagain:
        if (stat == RPC_SUCCESS) {
                error = 0;
        } else if (stat == RPC_TIMEDOUT) {
-               NFSINCRGLOBAL(nfsstatsv1.rpctimeouts);
+               NFSINCRGLOBAL(newnfsstats.rpctimeouts);
                error = ETIMEDOUT;
        } else if (stat == RPC_VERSMISMATCH) {
-               NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
+               NFSINCRGLOBAL(newnfsstats.rpcinvalid);
                error = EOPNOTSUPP;
        } else if (stat == RPC_PROGVERSMISMATCH) {
-               NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
+               NFSINCRGLOBAL(newnfsstats.rpcinvalid);
                error = EPROTONOSUPPORT;
        } else if (stat == RPC_INTR) {
                error = EINTR;
        } else {
-               NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
+               NFSINCRGLOBAL(newnfsstats.rpcinvalid);
                error = EACCES;
        }
        if (error) {

Modified: stable/10/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- stable/10/sys/fs/nfs/nfs_commonport.c       Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfs/nfs_commonport.c       Mon Oct  3 23:17:57 2016        
(r306663)
@@ -58,7 +58,7 @@ extern void (*nfsd_call_recall)(struct v
 extern int nfsrv_useacl;
 struct mount nfsv4root_mnt;
 int newnfs_numnfsd = 0;
-struct nfsstatsv1 nfsstatsv1;
+struct nfsstats newnfsstats;
 int nfs_numnfscbd = 0;
 int nfscl_debuglevel = 0;
 char nfsv4_callbackaddr[INET6_ADDRSTRLEN];
@@ -69,7 +69,6 @@ void (*ncl_call_invalcaches)(struct vnod
 
 static int nfs_realign_test;
 static int nfs_realign_count;
-static struct ext_nfsstats oldnfsstats;
 
 SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "New NFS filesystem");
 SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test,
@@ -448,12 +447,9 @@ nfssvc_nfscommon(struct thread *td, stru
 static int
 nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
 {
-       int error = EINVAL, i, j;
+       int error = EINVAL;
        struct nfsd_idargs nid;
        struct nfsd_oidargs onid;
-       struct {
-               int vers;       /* Just the first field of nfsstats. */
-       } nfsstatver;
 
        if (uap->flag & NFSSVC_IDNAME) {
                if ((uap->flag & NFSSVC_NEWSTRUCT) != 0)
@@ -477,157 +473,63 @@ nfssvc_call(struct thread *p, struct nfs
                error = nfssvc_idname(&nid);
                goto out;
        } else if (uap->flag & NFSSVC_GETSTATS) {
-               if ((uap->flag & NFSSVC_NEWSTRUCT) == 0) {
-                       /* Copy fields to the old ext_nfsstat structure. */
-                       oldnfsstats.attrcache_hits =
-                           nfsstatsv1.attrcache_hits;
-                       oldnfsstats.attrcache_misses =
-                           nfsstatsv1.attrcache_misses;
-                       oldnfsstats.lookupcache_hits =
-                           nfsstatsv1.lookupcache_hits;
-                       oldnfsstats.lookupcache_misses =
-                           nfsstatsv1.lookupcache_misses;
-                       oldnfsstats.direofcache_hits =
-                           nfsstatsv1.direofcache_hits;
-                       oldnfsstats.direofcache_misses =
-                           nfsstatsv1.direofcache_misses;
-                       oldnfsstats.accesscache_hits =
-                           nfsstatsv1.accesscache_hits;
-                       oldnfsstats.accesscache_misses =
-                           nfsstatsv1.accesscache_misses;
-                       oldnfsstats.biocache_reads =
-                           nfsstatsv1.biocache_reads;
-                       oldnfsstats.read_bios =
-                           nfsstatsv1.read_bios;
-                       oldnfsstats.read_physios =
-                           nfsstatsv1.read_physios;
-                       oldnfsstats.biocache_writes =
-                           nfsstatsv1.biocache_writes;
-                       oldnfsstats.write_bios =
-                           nfsstatsv1.write_bios;
-                       oldnfsstats.write_physios =
-                           nfsstatsv1.write_physios;
-                       oldnfsstats.biocache_readlinks =
-                           nfsstatsv1.biocache_readlinks;
-                       oldnfsstats.readlink_bios =
-                           nfsstatsv1.readlink_bios;
-                       oldnfsstats.biocache_readdirs =
-                           nfsstatsv1.biocache_readdirs;
-                       oldnfsstats.readdir_bios =
-                           nfsstatsv1.readdir_bios;
-                       for (i = 0; i < NFSV4_NPROCS; i++)
-                               oldnfsstats.rpccnt[i] = nfsstatsv1.rpccnt[i];
-                       oldnfsstats.rpcretries = nfsstatsv1.rpcretries;
-                       for (i = 0; i < NFSV4OP_NOPS; i++)
-                               oldnfsstats.srvrpccnt[i] =
-                                   nfsstatsv1.srvrpccnt[i];
-                       for (i = NFSV42_NOPS, j = NFSV4OP_NOPS;
-                           i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++)
-                               oldnfsstats.srvrpccnt[j] =
-                                   nfsstatsv1.srvrpccnt[i];
-                       oldnfsstats.srvrpc_errs = nfsstatsv1.srvrpc_errs;
-                       oldnfsstats.srv_errs = nfsstatsv1.srv_errs;
-                       oldnfsstats.rpcrequests = nfsstatsv1.rpcrequests;
-                       oldnfsstats.rpctimeouts = nfsstatsv1.rpctimeouts;
-                       oldnfsstats.rpcunexpected = nfsstatsv1.rpcunexpected;
-                       oldnfsstats.rpcinvalid = nfsstatsv1.rpcinvalid;
-                       oldnfsstats.srvcache_inproghits =
-                           nfsstatsv1.srvcache_inproghits;
-                       oldnfsstats.srvcache_idemdonehits =
-                           nfsstatsv1.srvcache_idemdonehits;
-                       oldnfsstats.srvcache_nonidemdonehits =
-                           nfsstatsv1.srvcache_nonidemdonehits;
-                       oldnfsstats.srvcache_misses =
-                           nfsstatsv1.srvcache_misses;
-                       oldnfsstats.srvcache_tcppeak =
-                           nfsstatsv1.srvcache_tcppeak;
-                       oldnfsstats.srvcache_size = nfsstatsv1.srvcache_size;
-                       oldnfsstats.srvclients = nfsstatsv1.srvclients;
-                       oldnfsstats.srvopenowners = nfsstatsv1.srvopenowners;
-                       oldnfsstats.srvopens = nfsstatsv1.srvopens;
-                       oldnfsstats.srvlockowners = nfsstatsv1.srvlockowners;
-                       oldnfsstats.srvlocks = nfsstatsv1.srvlocks;
-                       oldnfsstats.srvdelegates = nfsstatsv1.srvdelegates;
-                       for (i = 0; i < NFSV4OP_CBNOPS; i++)
-                               oldnfsstats.cbrpccnt[i] =
-                                   nfsstatsv1.cbrpccnt[i];
-                       oldnfsstats.clopenowners = nfsstatsv1.clopenowners;
-                       oldnfsstats.clopens = nfsstatsv1.clopens;
-                       oldnfsstats.cllockowners = nfsstatsv1.cllockowners;
-                       oldnfsstats.cllocks = nfsstatsv1.cllocks;
-                       oldnfsstats.cldelegates = nfsstatsv1.cldelegates;
-                       oldnfsstats.cllocalopenowners =
-                           nfsstatsv1.cllocalopenowners;
-                       oldnfsstats.cllocalopens = nfsstatsv1.cllocalopens;
-                       oldnfsstats.cllocallockowners =
-                           nfsstatsv1.cllocallockowners;
-                       oldnfsstats.cllocallocks = nfsstatsv1.cllocallocks;
-                       error = copyout(&oldnfsstats, uap->argp,
-                           sizeof (oldnfsstats));
-               } else {
-                       error = copyin(uap->argp, &nfsstatver,
-                           sizeof(nfsstatver));
-                       if (error == 0 && nfsstatver.vers != NFSSTATS_V1)
-                               error = EPERM;
-                       if (error == 0)
-                               error = copyout(&nfsstatsv1, uap->argp,
-                                   sizeof (nfsstatsv1));
-               }
+               error = copyout(&newnfsstats,
+                   CAST_USER_ADDR_T(uap->argp), sizeof (newnfsstats));
                if (error == 0) {
                        if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) {
-                               nfsstatsv1.attrcache_hits = 0;
-                               nfsstatsv1.attrcache_misses = 0;
-                               nfsstatsv1.lookupcache_hits = 0;
-                               nfsstatsv1.lookupcache_misses = 0;
-                               nfsstatsv1.direofcache_hits = 0;
-                               nfsstatsv1.direofcache_misses = 0;
-                               nfsstatsv1.accesscache_hits = 0;
-                               nfsstatsv1.accesscache_misses = 0;
-                               nfsstatsv1.biocache_reads = 0;
-                               nfsstatsv1.read_bios = 0;
-                               nfsstatsv1.read_physios = 0;
-                               nfsstatsv1.biocache_writes = 0;
-                               nfsstatsv1.write_bios = 0;
-                               nfsstatsv1.write_physios = 0;
-                               nfsstatsv1.biocache_readlinks = 0;
-                               nfsstatsv1.readlink_bios = 0;
-                               nfsstatsv1.biocache_readdirs = 0;
-                               nfsstatsv1.readdir_bios = 0;
-                               nfsstatsv1.rpcretries = 0;
-                               nfsstatsv1.rpcrequests = 0;
-                               nfsstatsv1.rpctimeouts = 0;
-                               nfsstatsv1.rpcunexpected = 0;
-                               nfsstatsv1.rpcinvalid = 0;
-                               bzero(nfsstatsv1.rpccnt,
-                                   sizeof(nfsstatsv1.rpccnt));
+                               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) {
-                               nfsstatsv1.srvrpc_errs = 0;
-                               nfsstatsv1.srv_errs = 0;
-                               nfsstatsv1.srvcache_inproghits = 0;
-                               nfsstatsv1.srvcache_idemdonehits = 0;
-                               nfsstatsv1.srvcache_nonidemdonehits = 0;
-                               nfsstatsv1.srvcache_misses = 0;
-                               nfsstatsv1.srvcache_tcppeak = 0;
-                               nfsstatsv1.srvclients = 0;
-                               nfsstatsv1.srvopenowners = 0;
-                               nfsstatsv1.srvopens = 0;
-                               nfsstatsv1.srvlockowners = 0;
-                               nfsstatsv1.srvlocks = 0;
-                               nfsstatsv1.srvdelegates = 0;
-                               nfsstatsv1.clopenowners = 0;
-                               nfsstatsv1.clopens = 0;
-                               nfsstatsv1.cllockowners = 0;
-                               nfsstatsv1.cllocks = 0;
-                               nfsstatsv1.cldelegates = 0;
-                               nfsstatsv1.cllocalopenowners = 0;
-                               nfsstatsv1.cllocalopens = 0;
-                               nfsstatsv1.cllocallockowners = 0;
-                               nfsstatsv1.cllocallocks = 0;
-                               bzero(nfsstatsv1.srvrpccnt,
-                                   sizeof(nfsstatsv1.srvrpccnt));
-                               bzero(nfsstatsv1.cbrpccnt,
-                                   sizeof(nfsstatsv1.cbrpccnt));
+                               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.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));
                        }
                }
                goto out;

Modified: stable/10/sys/fs/nfs/nfsport.h
==============================================================================
--- stable/10/sys/fs/nfs/nfsport.h      Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfs/nfsport.h      Mon Oct  3 23:17:57 2016        
(r306663)
@@ -55,7 +55,6 @@
 #include <sys/malloc.h>
 #include <sys/mbuf.h>
 #include <sys/mount.h>
-#include <sys/mutex.h>
 #include <sys/namei.h>
 #include <sys/proc.h>
 #include <sys/protosw.h>
@@ -254,26 +253,24 @@
 
 /*
  * Must be one more than last op#.
- * NFSv4.2 isn't implemented yet, but define the op# limit for it.
  */
 #define        NFSV41_NOPS             59
-#define        NFSV42_NOPS             72
 
 /* Quirky case if the illegal op code */
 #define        NFSV4OP_OPILLEGAL       10044
 
 /*
- * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV42_NOPS.
+ * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV4OP_NOPS.
  */
-#define        NFSV4OP_SYMLINK         (NFSV42_NOPS)
-#define        NFSV4OP_MKDIR           (NFSV42_NOPS + 1)
-#define        NFSV4OP_RMDIR           (NFSV42_NOPS + 2)
-#define        NFSV4OP_READDIRPLUS     (NFSV42_NOPS + 3)
-#define        NFSV4OP_MKNOD           (NFSV42_NOPS + 4)
-#define        NFSV4OP_FSSTAT          (NFSV42_NOPS + 5)
-#define        NFSV4OP_FSINFO          (NFSV42_NOPS + 6)
-#define        NFSV4OP_PATHCONF        (NFSV42_NOPS + 7)
-#define        NFSV4OP_V3CREATE        (NFSV42_NOPS + 8)
+#define        NFSV4OP_SYMLINK         (NFSV4OP_NOPS)
+#define        NFSV4OP_MKDIR           (NFSV4OP_NOPS + 1)
+#define        NFSV4OP_RMDIR           (NFSV4OP_NOPS + 2)
+#define        NFSV4OP_READDIRPLUS     (NFSV4OP_NOPS + 3)
+#define        NFSV4OP_MKNOD           (NFSV4OP_NOPS + 4)
+#define        NFSV4OP_FSSTAT          (NFSV4OP_NOPS + 5)
+#define        NFSV4OP_FSINFO          (NFSV4OP_NOPS + 6)
+#define        NFSV4OP_PATHCONF        (NFSV4OP_NOPS + 7)
+#define        NFSV4OP_V3CREATE        (NFSV4OP_NOPS + 8)
 
 /*
  * This is the count of the fake operations listed above.
@@ -287,12 +284,12 @@
 #define        NFSV4OP_CBRECALL        4
 
 /*
- * Must be one greater than the last Callback Operation# for NFSv4.0.
+ * Must be one greater than the last Callback Operation#.
  */
 #define        NFSV4OP_CBNOPS          5
 
 /*
- * Additional Callback Ops for NFSv4.1 only.
+ * Additional Callback Ops for NFSv4.1 only. Not yet in nfsstats.
  */
 #define        NFSV4OP_CBLAYOUTRECALL  5
 #define        NFSV4OP_CBNOTIFY        6
@@ -305,9 +302,6 @@
 #define        NFSV4OP_CBNOTIFYLOCK    13
 #define        NFSV4OP_CBNOTIFYDEVID   14
 
-#define        NFSV41_CBNOPS           15
-#define        NFSV42_CBNOPS           16
-
 /*
  * The lower numbers -> 21 are used by NFSv2 and v3. These define higher
  * numbers used by NFSv4.
@@ -365,72 +359,7 @@
 #endif /* NFS_V3NPROCS */
 
 /*
- * New stats structure.
- * The vers field will be set to NFSSTATS_V1 by the caller.
- */
-#define        NFSSTATS_V1     1
-struct nfsstatsv1 {
-       int             vers;   /* Set to version requested by caller. */
-       uint64_t        attrcache_hits;
-       uint64_t        attrcache_misses;
-       uint64_t        lookupcache_hits;
-       uint64_t        lookupcache_misses;
-       uint64_t        direofcache_hits;
-       uint64_t        direofcache_misses;
-       uint64_t        accesscache_hits;
-       uint64_t        accesscache_misses;
-       uint64_t        biocache_reads;
-       uint64_t        read_bios;
-       uint64_t        read_physios;
-       uint64_t        biocache_writes;
-       uint64_t        write_bios;
-       uint64_t        write_physios;
-       uint64_t        biocache_readlinks;
-       uint64_t        readlink_bios;
-       uint64_t        biocache_readdirs;
-       uint64_t        readdir_bios;
-       uint64_t        rpccnt[NFSV41_NPROCS + 15];
-       uint64_t        rpcretries;
-       uint64_t        srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS];
-       uint64_t        srvrpc_errs;
-       uint64_t        srv_errs;
-       uint64_t        rpcrequests;
-       uint64_t        rpctimeouts;
-       uint64_t        rpcunexpected;
-       uint64_t        rpcinvalid;
-       uint64_t        srvcache_inproghits;
-       uint64_t        srvcache_idemdonehits;
-       uint64_t        srvcache_nonidemdonehits;
-       uint64_t        srvcache_misses;
-       uint64_t        srvcache_tcppeak;
-       int             srvcache_size;  /* Updated by atomic_xx_int(). */
-       uint64_t        srvclients;
-       uint64_t        srvopenowners;
-       uint64_t        srvopens;
-       uint64_t        srvlockowners;
-       uint64_t        srvlocks;
-       uint64_t        srvdelegates;
-       uint64_t        cbrpccnt[NFSV42_CBNOPS];
-       uint64_t        clopenowners;
-       uint64_t        clopens;
-       uint64_t        cllockowners;
-       uint64_t        cllocks;
-       uint64_t        cldelegates;
-       uint64_t        cllocalopenowners;
-       uint64_t        cllocalopens;
-       uint64_t        cllocallockowners;
-       uint64_t        cllocallocks;
-       uint64_t        srvstartcnt;
-       uint64_t        srvdonecnt;
-       uint64_t        srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS];
-       uint64_t        srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS];
-       struct bintime  srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS];
-       struct bintime  busyfrom;
-       struct bintime  busytime;
-};
-
-/*
- * Old stats structure.
+ * Stats structure
  */
 struct ext_nfsstats {
        int     attrcache_hits;
@@ -486,6 +415,11 @@ struct ext_nfsstats {
 
 #ifdef _KERNEL
 /*
+ * Define the ext_nfsstats as nfsstats for the kernel code.
+ */
+#define nfsstats       ext_nfsstats
+
+/*
  * Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code.
  */
 #ifndef        NFS_NPROCS

Modified: stable/10/sys/fs/nfs/nfsproto.h
==============================================================================
--- stable/10/sys/fs/nfs/nfsproto.h     Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfs/nfsproto.h     Mon Oct  3 23:17:57 2016        
(r306663)
@@ -345,10 +345,10 @@
 
 /*
  * NFSPROC_NOOP is a fake op# that can't be the same as any V2/3/4 Procedure
- * or Operation#. Since the NFS V4 Op #s go higher, use NFSV42_NOPS, which
+ * or Operation#. Since the NFS V4 Op #s go higher, use NFSV41_NOPS, which
  * is one greater than the highest Op#.
  */
-#define        NFSPROC_NOOP            NFSV42_NOPS
+#define        NFSPROC_NOOP            NFSV41_NOPS
 
 /* Actual Version 2 procedure numbers */
 #define        NFSV2PROC_NULL          0

Modified: stable/10/sys/fs/nfsclient/nfs_clbio.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clbio.c      Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfsclient/nfs_clbio.c      Mon Oct  3 23:17:57 2016        
(r306663)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
 #include <fs/nfsclient/nfs_kdtrace.h>
 
 extern int newnfs_directio_allow_mmap;
-extern struct nfsstatsv1 nfsstatsv1;
+extern struct nfsstats newnfsstats;
 extern struct mtx ncl_iod_mutex;
 extern int ncl_numasync;
 extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];
@@ -482,7 +482,7 @@ ncl_bioread(struct vnode *vp, struct uio
 
            switch (vp->v_type) {
            case VREG:
-               NFSINCRGLOBAL(nfsstatsv1.biocache_reads);
+               NFSINCRGLOBAL(newnfsstats.biocache_reads);
                lbn = uio->uio_offset / biosize;
                on = uio->uio_offset - (lbn * biosize);
 
@@ -559,7 +559,7 @@ ncl_bioread(struct vnode *vp, struct uio
                        n = MIN((unsigned)(bcount - on), uio->uio_resid);
                break;
            case VLNK:
-               NFSINCRGLOBAL(nfsstatsv1.biocache_readlinks);
+               NFSINCRGLOBAL(newnfsstats.biocache_readlinks);
                bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td);
                if (!bp) {
                        error = newnfs_sigintr(nmp, td);
@@ -579,7 +579,7 @@ ncl_bioread(struct vnode *vp, struct uio
                on = 0;
                break;
            case VDIR:
-               NFSINCRGLOBAL(nfsstatsv1.biocache_readdirs);
+               NFSINCRGLOBAL(newnfsstats.biocache_readdirs);
                if (np->n_direofoffset
                    && uio->uio_offset >= np->n_direofoffset) {
                    return (0);
@@ -1008,7 +1008,7 @@ ncl_write(struct vop_write_args *ap)
                        }
                }
 
-               NFSINCRGLOBAL(nfsstatsv1.biocache_writes);
+               NFSINCRGLOBAL(newnfsstats.biocache_writes);
                lbn = uio->uio_offset / biosize;
                on = uio->uio_offset - (lbn * biosize);
                n = MIN((unsigned)(biosize - on), uio->uio_resid);
@@ -1622,7 +1622,7 @@ ncl_doio(struct vnode *vp, struct buf *b
            switch (vp->v_type) {
            case VREG:
                uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE;
-               NFSINCRGLOBAL(nfsstatsv1.read_bios);
+               NFSINCRGLOBAL(newnfsstats.read_bios);
                error = ncl_readrpc(vp, uiop, cr);
 
                if (!error) {
@@ -1657,11 +1657,11 @@ ncl_doio(struct vnode *vp, struct buf *b
                break;
            case VLNK:
                uiop->uio_offset = (off_t)0;
-               NFSINCRGLOBAL(nfsstatsv1.readlink_bios);
+               NFSINCRGLOBAL(newnfsstats.readlink_bios);
                error = ncl_readlinkrpc(vp, uiop, cr);
                break;
            case VDIR:
-               NFSINCRGLOBAL(nfsstatsv1.readdir_bios);
+               NFSINCRGLOBAL(newnfsstats.readdir_bios);
                uiop->uio_offset = ((u_quad_t)bp->b_lblkno) * NFS_DIRBLKSIZ;
                if ((nmp->nm_flag & NFSMNT_RDIRPLUS) != 0) {
                        error = ncl_readdirplusrpc(vp, uiop, cr, td);
@@ -1723,7 +1723,7 @@ ncl_doio(struct vnode *vp, struct buf *b
                    + bp->b_dirtyoff;
                io.iov_base = (char *)bp->b_data + bp->b_dirtyoff;
                uiop->uio_rw = UIO_WRITE;
-               NFSINCRGLOBAL(nfsstatsv1.write_bios);
+               NFSINCRGLOBAL(newnfsstats.write_bios);
 
                if ((bp->b_flags & (B_ASYNC | B_NEEDCOMMIT | B_NOCACHE | 
B_CLUSTER)) == B_ASYNC)
                    iomode = NFSWRITE_UNSTABLE;

Modified: stable/10/sys/fs/nfsclient/nfs_clcomsubs.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clcomsubs.c  Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfsclient/nfs_clcomsubs.c  Mon Oct  3 23:17:57 2016        
(r306663)
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
 #ifndef APPLEKEXT
 #include <fs/nfs/nfsport.h>
 
-extern struct nfsstatsv1 nfsstatsv1;
+extern struct nfsstats newnfsstats;
 extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS];
 extern int ncl_mbuf_mlen;
 extern enum vtype newnv2tov_type[8];
@@ -241,8 +241,8 @@ nfscl_reqstart(struct nfsrv_descript *nd
        } else {
                (void) nfsm_fhtom(nd, nfhp, fhlen, 0);
        }
-       if (procnum < NFSV41_NPROCS)
-               NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]);
+       if (procnum < NFSV4_NPROCS)
+               NFSINCRGLOBAL(newnfsstats.rpccnt[procnum]);
 }
 
 #ifndef APPLE

Modified: stable/10/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clstate.c    Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfsclient/nfs_clstate.c    Mon Oct  3 23:17:57 2016        
(r306663)
@@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$");
 /*
  * Global variables
  */
-extern struct nfsstatsv1 nfsstatsv1;
+extern struct nfsstats newnfsstats;
 extern struct nfsreqhead nfsd_reqq;
 extern u_int32_t newnfs_false, newnfs_true;
 extern int nfscl_debuglevel;
@@ -343,10 +343,10 @@ nfscl_newopen(struct nfsclclient *clp, s
                nowp->nfsow_defunct = 0;
                nfscl_lockinit(&nowp->nfsow_rwlock);
                if (dp != NULL) {
-                       nfsstatsv1.cllocalopenowners++;
+                       newnfsstats.cllocalopenowners++;
                        LIST_INSERT_HEAD(&dp->nfsdl_owner, nowp, nfsow_list);
                } else {
-                       nfsstatsv1.clopenowners++;
+                       newnfsstats.clopenowners++;
                        LIST_INSERT_HEAD(&clp->nfsc_owner, nowp, nfsow_list);
                }
                owp = *owpp = nowp;
@@ -380,9 +380,9 @@ nfscl_newopen(struct nfsclclient *clp, s
                                TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp,
                                    nfsdl_list);
                                dp->nfsdl_timestamp = NFSD_MONOSEC + 120;
-                               nfsstatsv1.cllocalopens++;
+                               newnfsstats.cllocalopens++;
                        } else {
-                               nfsstatsv1.clopens++;
+                               newnfsstats.clopens++;
                        }
                        LIST_INSERT_HEAD(&owp->nfsow_open, nop, nfso_list);
                        *opp = nop;
@@ -430,7 +430,7 @@ nfscl_deleg(mount_t mp, struct nfsclclie
                LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, fhlen), dp,
                    nfsdl_hash);
                dp->nfsdl_timestamp = NFSD_MONOSEC + 120;
-               nfsstatsv1.cldelegates++;
+               newnfsstats.cldelegates++;
                nfscl_delegcnt++;
        } else {
                /*
@@ -1071,10 +1071,10 @@ nfscl_getbytelock(vnode_t vp, u_int64_t 
                LIST_INIT(&nlp->nfsl_lock);
                if (donelocally) {
                        nlp->nfsl_open = NULL;
-                       nfsstatsv1.cllocallockowners++;
+                       newnfsstats.cllocallockowners++;
                } else {
                        nlp->nfsl_open = op;
-                       nfsstatsv1.cllockowners++;
+                       newnfsstats.cllockowners++;
                }
                LIST_INSERT_HEAD(lhp, nlp, nfsl_list);
                lp = nlp;
@@ -1402,9 +1402,9 @@ nfscl_freeopen(struct nfsclopen *op, int
        nfscl_freealllocks(&op->nfso_lock, local);
        FREE((caddr_t)op, M_NFSCLOPEN);
        if (local)
-               nfsstatsv1.cllocalopens--;
+               newnfsstats.cllocalopens--;
        else
-               nfsstatsv1.clopens--;
+               newnfsstats.clopens--;
 }
 
 /*
@@ -1483,9 +1483,9 @@ nfscl_freeopenowner(struct nfsclowner *o
        LIST_REMOVE(owp, nfsow_list);
        FREE((caddr_t)owp, M_NFSCLOWNER);
        if (local)
-               nfsstatsv1.cllocalopenowners--;
+               newnfsstats.cllocalopenowners--;
        else
-               nfsstatsv1.clopenowners--;
+               newnfsstats.clopenowners--;
 }
 
 /*
@@ -1502,9 +1502,9 @@ nfscl_freelockowner(struct nfscllockowne
        }
        FREE((caddr_t)lp, M_NFSCLLOCKOWNER);
        if (local)
-               nfsstatsv1.cllocallockowners--;
+               newnfsstats.cllocallockowners--;
        else
-               nfsstatsv1.cllockowners--;
+               newnfsstats.cllockowners--;
 }
 
 /*
@@ -1517,9 +1517,9 @@ nfscl_freelock(struct nfscllock *lop, in
        LIST_REMOVE(lop, nfslo_list);
        FREE((caddr_t)lop, M_NFSCLLOCK);
        if (local)
-               nfsstatsv1.cllocallocks--;
+               newnfsstats.cllocallocks--;
        else
-               nfsstatsv1.cllocks--;
+               newnfsstats.cllocks--;
 }
 
 /*
@@ -1553,7 +1553,7 @@ nfscl_freedeleg(struct nfscldeleghead *h
        TAILQ_REMOVE(hdp, dp, nfsdl_list);
        LIST_REMOVE(dp, nfsdl_hash);
        FREE((caddr_t)dp, M_NFSCLDELEG);
-       nfsstatsv1.cldelegates--;
+       newnfsstats.cldelegates--;
        nfscl_delegcnt--;
 }
 
@@ -1621,18 +1621,18 @@ nfscl_expireclient(struct nfsclclient *c
                            LIST_REMOVE(op, nfso_list);
                            op->nfso_own = towp;
                            LIST_INSERT_HEAD(&towp->nfsow_open, op, nfso_list);
-                           nfsstatsv1.cllocalopens--;
-                           nfsstatsv1.clopens++;
+                           newnfsstats.cllocalopens--;
+                           newnfsstats.clopens++;
                        }
                    } else {
                        /* Just add the openowner to the client list */
                        LIST_REMOVE(owp, nfsow_list);
                        owp->nfsow_clp = clp;
                        LIST_INSERT_HEAD(&clp->nfsc_owner, owp, nfsow_list);
-                       nfsstatsv1.cllocalopenowners--;
-                       nfsstatsv1.clopenowners++;
-                       nfsstatsv1.cllocalopens--;
-                       nfsstatsv1.clopens++;
+                       newnfsstats.cllocalopenowners--;
+                       newnfsstats.clopenowners++;
+                       newnfsstats.cllocalopens--;
+                       newnfsstats.clopens++;
                    }
                }
                owp = nowp;
@@ -2282,9 +2282,9 @@ nfscl_insertlock(struct nfscllockowner *
        else
                LIST_INSERT_AFTER(insert_lop, new_lop, nfslo_list);
        if (local)
-               nfsstatsv1.cllocallocks++;
+               newnfsstats.cllocallocks++;
        else
-               nfsstatsv1.cllocks++;
+               newnfsstats.cllocks++;
 }
 
 /*
@@ -2571,7 +2571,7 @@ tryagain:
                                    LIST_REMOVE(dp, nfsdl_hash);
                                    TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list);
                                    nfscl_delegcnt--;
-                                   nfsstatsv1.cldelegates--;
+                                   newnfsstats.cldelegates--;
                                }
                                NFSLOCKCLSTATE();
                        }
@@ -2612,7 +2612,7 @@ tryagain:
                            LIST_REMOVE(dp, nfsdl_hash);
                            TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list);
                            nfscl_delegcnt--;
-                           nfsstatsv1.cldelegates--;
+                           newnfsstats.cldelegates--;
                        }
                    }
                    dp = ndp;
@@ -3215,8 +3215,8 @@ nfscl_docb(struct nfsrv_descript *nd, NF
                    break;
                }
                nd->nd_procnum = op;
-               if (op < NFSV41_CBNOPS)
-                       nfsstatsv1.cbrpccnt[nd->nd_procnum]++;
+               if (op < NFSV4OP_CBNOPS)
+                       newnfsstats.cbrpccnt[nd->nd_procnum]++;
                switch (op) {
                case NFSV4OP_CBGETATTR:
                        NFSCL_DEBUG(4, "cbgetattr\n");

Modified: stable/10/sys/fs/nfsclient/nfs_clsubs.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clsubs.c     Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfsclient/nfs_clsubs.c     Mon Oct  3 23:17:57 2016        
(r306663)
@@ -85,7 +85,7 @@ extern enum nfsiod_state ncl_iodwant[NFS
 extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON];
 extern int ncl_numasync;
 extern unsigned int ncl_iodmax;
-extern struct nfsstatsv1 nfsstatsv1;
+extern struct nfsstats newnfsstats;
 
 struct task    ncl_nfsiodnew_task;
 
@@ -221,12 +221,12 @@ ncl_getattrcache(struct vnode *vp, struc
 
        if ((time_second - np->n_attrstamp) >= timeo &&
            (mustflush != 0 || np->n_attrstamp == 0)) {
-               nfsstatsv1.attrcache_misses++;
+               newnfsstats.attrcache_misses++;
                mtx_unlock(&np->n_mtx);
                KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
                return( ENOENT);
        }
-       nfsstatsv1.attrcache_hits++;
+       newnfsstats.attrcache_hits++;
        if (vap->va_size != np->n_size) {
                if (vap->va_type == VREG) {
                        if (np->n_flag & NMODIFIED) {

Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clvfsops.c   Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfsclient/nfs_clvfsops.c   Mon Oct  3 23:17:57 2016        
(r306663)
@@ -78,6 +78,7 @@ FEATURE(nfscl, "NFSv4 client");
 
 extern int nfscl_ticks;
 extern struct timeval nfsboottime;
+extern struct nfsstats newnfsstats;
 extern int nfsrv_useacl;
 extern int nfscl_debuglevel;
 extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];

Modified: stable/10/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clvnops.c    Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfsclient/nfs_clvnops.c    Mon Oct  3 23:17:57 2016        
(r306663)
@@ -101,7 +101,7 @@ uint32_t    nfscl_accesscache_load_done_id;
 #define        TRUE    1
 #define        FALSE   0
 
-extern struct nfsstatsv1 nfsstatsv1;
+extern struct nfsstats newnfsstats;
 extern int nfsrv_useacl;
 extern int nfscl_debuglevel;
 MALLOC_DECLARE(M_NEWNFSREQ);
@@ -259,6 +259,14 @@ int newnfs_directio_allow_mmap = 1;
 SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW,
           &newnfs_directio_allow_mmap, 0, "Enable mmaped IO on file with 
O_DIRECT opens");
 
+#if 0
+SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_hits, CTLFLAG_RD,
+          &newnfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count");
+
+SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_misses, CTLFLAG_RD,
+          &newnfsstats.accesscache_misses, 0, "NFS ACCESS cache miss count");
+#endif
+
 #define        NFSACCESS_ALL (NFSACCESS_READ | NFSACCESS_MODIFY                
\
                         | NFSACCESS_EXTEND | NFSACCESS_EXECUTE \
                         | NFSACCESS_DELETE | NFSACCESS_LOOKUP)
@@ -411,7 +419,7 @@ nfs_access(struct vop_access_args *ap)
                            if (time_second < (np->n_accesscache[i].stamp
                                + nfsaccess_cache_timeout) &&
                                (np->n_accesscache[i].mode & mode) == mode) {
-                               NFSINCRGLOBAL(nfsstatsv1.accesscache_hits);
+                               NFSINCRGLOBAL(newnfsstats.accesscache_hits);
                                gotahit = 1;
                            }
                            break;
@@ -430,7 +438,7 @@ nfs_access(struct vop_access_args *ap)
                        /*
                         * Either a no, or a don't know.  Go to the wire.
                         */
-                       NFSINCRGLOBAL(nfsstatsv1.accesscache_misses);
+                       NFSINCRGLOBAL(newnfsstats.accesscache_misses);
                        error = nfs34_access_otw(vp, wmode, ap->a_td,
                            ap->a_cred, &rmode);
                        if (!error &&
@@ -850,7 +858,7 @@ nfs_getattr(struct vop_getattr_args *ap)
 
        if (NFS_ISV34(vp) && nfs_prime_access_cache &&
            nfsaccess_cache_timeout > 0) {
-               NFSINCRGLOBAL(nfsstatsv1.accesscache_misses);
+               NFSINCRGLOBAL(newnfsstats.accesscache_misses);
                nfs34_access_otw(vp, NFSACCESS_ALL, td, ap->a_cred, NULL);
                if (ncl_getattrcache(vp, ap->a_vap) == 0) {
                        nfscl_deleggetmodtime(vp, &ap->a_vap->va_mtime);
@@ -1107,7 +1115,7 @@ nfs_lookup(struct vop_lookup_args *ap)
                    ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) &&
                    VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 &&
                    timespeccmp(&vattr.va_ctime, &nctime, ==))) {
-                       NFSINCRGLOBAL(nfsstatsv1.lookupcache_hits);
+                       NFSINCRGLOBAL(newnfsstats.lookupcache_hits);
                        if (cnp->cn_nameiop != LOOKUP &&
                            (flags & ISLASTCN))
                                cnp->cn_flags |= SAVENAME;
@@ -1134,7 +1142,7 @@ nfs_lookup(struct vop_lookup_args *ap)
                if ((u_int)(ticks - ncticks) < (nmp->nm_negnametimeo * hz) &&
                    VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 &&
                    timespeccmp(&vattr.va_mtime, &nctime, ==)) {
-                       NFSINCRGLOBAL(nfsstatsv1.lookupcache_hits);
+                       NFSINCRGLOBAL(newnfsstats.lookupcache_hits);
                        return (ENOENT);
                }
                cache_purge_negative(dvp);
@@ -1142,7 +1150,7 @@ nfs_lookup(struct vop_lookup_args *ap)
 
        error = 0;
        newvp = NULLVP;
-       NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses);
+       NFSINCRGLOBAL(newnfsstats.lookupcache_misses);
        error = nfsrpc_lookup(dvp, cnp->cn_nameptr, cnp->cn_namelen,
            cnp->cn_cred, td, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag,
            NULL);
@@ -2220,7 +2228,7 @@ nfs_readdir(struct vop_readdir_args *ap)
                        if ((NFS_ISV4(vp) && np->n_change == vattr.va_filerev) 
||
                            !NFS_TIMESPEC_COMPARE(&np->n_mtime, 
&vattr.va_mtime)) {
                                mtx_unlock(&np->n_mtx);
-                               NFSINCRGLOBAL(nfsstatsv1.direofcache_hits);
+                               NFSINCRGLOBAL(newnfsstats.direofcache_hits);
                                if (ap->a_eofflag != NULL)
                                        *ap->a_eofflag = 1;
                                return (0);
@@ -2247,7 +2255,7 @@ nfs_readdir(struct vop_readdir_args *ap)
        error = ncl_bioread(vp, uio, 0, ap->a_cred);
 
        if (!error && uio->uio_resid == tresid) {
-               NFSINCRGLOBAL(nfsstatsv1.direofcache_misses);
+               NFSINCRGLOBAL(newnfsstats.direofcache_misses);
                if (ap->a_eofflag != NULL)
                        *ap->a_eofflag = 1;
        }

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdcache.c
==============================================================================
--- stable/10/sys/fs/nfsserver/nfs_nfsdcache.c  Mon Oct  3 23:16:38 2016        
(r306662)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdcache.c  Mon Oct  3 23:17:57 2016        
(r306663)
@@ -159,7 +159,7 @@ __FBSDID("$FreeBSD$");
 #ifndef APPLEKEXT
 #include <fs/nfs/nfsport.h>
 
-extern struct nfsstatsv1 nfsstatsv1;
+extern struct nfsstats newnfsstats;
 extern struct mtx nfsrc_udpmtx;
 extern struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE];
 extern struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE];
@@ -318,8 +318,8 @@ nfsrvd_initcache(void)
        TAILQ_INIT(&nfsrvudplru);
        nfsrc_tcpsavedreplies = 0;
        nfsrc_udpcachesize = 0;
-       nfsstatsv1.srvcache_tcppeak = 0;
-       nfsstatsv1.srvcache_size = 0;
+       newnfsstats.srvcache_tcppeak = 0;
+       newnfsstats.srvcache_size = 0;
 }
 
 /*
@@ -395,14 +395,14 @@ loop:
                        TAILQ_REMOVE(&nfsrvudplru, rp, rc_lru);
                        TAILQ_INSERT_TAIL(&nfsrvudplru, rp, rc_lru);
                        if (rp->rc_flag & RC_INPROG) {
-                               nfsstatsv1.srvcache_inproghits++;
+                               newnfsstats.srvcache_inproghits++;
                                mtx_unlock(mutex);
                                ret = RC_DROPIT;
                        } else if (rp->rc_flag & RC_REPSTATUS) {
                                /*
                                 * V2 only.
                                 */
-                               nfsstatsv1.srvcache_nonidemdonehits++;
+                               newnfsstats.srvcache_nonidemdonehits++;
                                mtx_unlock(mutex);
                                nfsrvd_rephead(nd);
                                *(nd->nd_errp) = rp->rc_status;
@@ -410,7 +410,7 @@ loop:
                                rp->rc_timestamp = NFSD_MONOSEC +
                                        NFSRVCACHE_UDPTIMEOUT;
                        } else if (rp->rc_flag & RC_REPMBUF) {
-                               nfsstatsv1.srvcache_nonidemdonehits++;
+                               newnfsstats.srvcache_nonidemdonehits++;
                                mtx_unlock(mutex);
                                nd->nd_mreq = m_copym(rp->rc_reply, 0,
                                        M_COPYALL, M_WAITOK);
@@ -425,8 +425,8 @@ loop:
                        goto out;
                }
        }
-       nfsstatsv1.srvcache_misses++;
-       atomic_add_int(&nfsstatsv1.srvcache_size, 1);
+       newnfsstats.srvcache_misses++;
+       atomic_add_int(&newnfsstats.srvcache_size, 1);
        nfsrc_udpcachesize++;
 
        newrp->rc_flag |= RC_INPROG;
@@ -480,7 +480,7 @@ nfsrvd_updatecache(struct nfsrv_descript
         * Reply from cache is a special case returned by nfsrv_checkseqid().
         */
        if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) {
-               nfsstatsv1.srvcache_nonidemdonehits++;
+               newnfsstats.srvcache_nonidemdonehits++;
                mtx_unlock(mutex);
                nd->nd_repstat = 0;
                if (nd->nd_mreq)
@@ -519,8 +519,8 @@ nfsrvd_updatecache(struct nfsrv_descript
                        if (!(rp->rc_flag & RC_UDP)) {
                            atomic_add_int(&nfsrc_tcpsavedreplies, 1);
                            if (nfsrc_tcpsavedreplies >
-                               nfsstatsv1.srvcache_tcppeak)
-                               nfsstatsv1.srvcache_tcppeak =
+                               newnfsstats.srvcache_tcppeak)
+                               newnfsstats.srvcache_tcppeak =
                                    nfsrc_tcpsavedreplies;
                        }
                        mtx_unlock(mutex);
@@ -678,7 +678,7 @@ tryagain:
                        panic("nfs tcp cache0");
                rp->rc_flag |= RC_LOCKED;
                if (rp->rc_flag & RC_INPROG) {
-                       nfsstatsv1.srvcache_inproghits++;
+                       newnfsstats.srvcache_inproghits++;
                        mtx_unlock(mutex);
                        if (newrp->rc_sockref == rp->rc_sockref)
                                nfsrc_marksametcpconn(rp->rc_sockref);
@@ -687,7 +687,7 @@ tryagain:
                        /*
                         * V2 only.
                         */
-                       nfsstatsv1.srvcache_nonidemdonehits++;
+                       newnfsstats.srvcache_nonidemdonehits++;
                        mtx_unlock(mutex);
                        if (newrp->rc_sockref == rp->rc_sockref)
                                nfsrc_marksametcpconn(rp->rc_sockref);
@@ -696,7 +696,7 @@ tryagain:
                        *(nd->nd_errp) = rp->rc_status;
                        rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout;
                } else if (rp->rc_flag & RC_REPMBUF) {
-                       nfsstatsv1.srvcache_nonidemdonehits++;
+                       newnfsstats.srvcache_nonidemdonehits++;
                        mtx_unlock(mutex);
                        if (newrp->rc_sockref == rp->rc_sockref)
                                nfsrc_marksametcpconn(rp->rc_sockref);
@@ -711,8 +711,8 @@ tryagain:
                free((caddr_t)newrp, M_NFSRVCACHE);
                goto out;
        }
-       nfsstatsv1.srvcache_misses++;
-       atomic_add_int(&nfsstatsv1.srvcache_size, 1);
+       newnfsstats.srvcache_misses++;
+       atomic_add_int(&newnfsstats.srvcache_size, 1);
 
        /*
         * For TCP, multiple entries for a key are allowed, so don't
@@ -801,7 +801,7 @@ nfsrc_freecache(struct nfsrvcache *rp)
                        atomic_add_int(&nfsrc_tcpsavedreplies, -1);
        }
        FREE((caddr_t)rp, M_NFSRVCACHE);
-       atomic_add_int(&nfsstatsv1.srvcache_size, -1);
+       atomic_add_int(&newnfsstats.srvcache_size, -1);
 }

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "[email protected]"

Reply via email to