Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102954270
D38743.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
49 KB
Referenced Files
None
Subscribers
None
D38743.diff
View Options
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -92,7 +92,6 @@
NFSREQSPINLOCK;
NFSDLOCKMUTEX;
NFSCLSTATEMUTEX;
-extern struct nfsstatsv1 nfsstatsv1;
extern struct nfsreqhead nfsd_reqq;
extern int nfscl_ticks;
extern void (*ncl_call_invalcaches)(struct vnode *);
@@ -782,7 +781,7 @@
procnum = NFSV4PROC_COMPOUND;
if (nmp != NULL) {
- NFSINCRGLOBAL(nfsstatsv1.rpcrequests);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpcrequests);
/* Map the procnum to the old NFSv2 one, as required. */
if ((nd->nd_flag & ND_NFSV2) != 0) {
@@ -917,13 +916,13 @@
if (stat == RPC_SUCCESS) {
error = 0;
} else if (stat == RPC_TIMEDOUT) {
- NFSINCRGLOBAL(nfsstatsv1.rpctimeouts);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpctimeouts);
error = ETIMEDOUT;
} else if (stat == RPC_VERSMISMATCH) {
- NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpcinvalid);
error = EOPNOTSUPP;
} else if (stat == RPC_PROGVERSMISMATCH) {
- NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpcinvalid);
error = EPROTONOSUPPORT;
} else if (stat == RPC_CANTSEND || stat == RPC_CANTRECV ||
stat == RPC_SYSTEMERROR || stat == RPC_INTR) {
@@ -957,11 +956,11 @@
if (stat == RPC_INTR)
error = EINTR;
else {
- NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpcinvalid);
error = ENXIO;
}
} else {
- NFSINCRGLOBAL(nfsstatsv1.rpcinvalid);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpcinvalid);
error = EACCES;
}
if (error) {
diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c
--- a/sys/fs/nfs/nfs_commonport.c
+++ b/sys/fs/nfs/nfs_commonport.c
@@ -60,7 +60,6 @@
struct thread *);
extern int nfsrv_useacl;
int newnfs_numnfsd = 0;
-struct nfsstatsv1 nfsstatsv1;
int nfs_numnfscbd = 0;
int nfscl_debuglevel = 0;
char nfsv4_callbackaddr[INET6_ADDRSTRLEN];
@@ -73,7 +72,7 @@
vop_reclaim_t *nfs_reclaim_p = NULL;
uint32_t nfs_srvmaxio = NFS_SRVMAXIO;
-NFSD_VNET_DEFINE(struct nfsstatsv1 *, nfsstatsv1_p);
+NFSD_VNET_DEFINE(struct nfsstatsv1, nfsstatsv1);
NFSD_VNET_DECLARE(struct nfssockreq, nfsrv_nfsuserdsock);
NFSD_VNET_DECLARE(nfsuserd_state, nfsrv_nfsuserd);
@@ -477,105 +476,105 @@
if ((uap->flag & NFSSVC_NEWSTRUCT) == 0) {
/* Copy fields to the old ext_nfsstat structure. */
oldnfsstats.attrcache_hits =
- NFSD_VNET(nfsstatsv1_p)->attrcache_hits;
+ NFSD_VNET(nfsstatsv1).attrcache_hits;
oldnfsstats.attrcache_misses =
- NFSD_VNET(nfsstatsv1_p)->attrcache_misses;
+ NFSD_VNET(nfsstatsv1).attrcache_misses;
oldnfsstats.lookupcache_hits =
- NFSD_VNET(nfsstatsv1_p)->lookupcache_hits;
+ NFSD_VNET(nfsstatsv1).lookupcache_hits;
oldnfsstats.lookupcache_misses =
- NFSD_VNET(nfsstatsv1_p)->lookupcache_misses;
+ NFSD_VNET(nfsstatsv1).lookupcache_misses;
oldnfsstats.direofcache_hits =
- NFSD_VNET(nfsstatsv1_p)->direofcache_hits;
+ NFSD_VNET(nfsstatsv1).direofcache_hits;
oldnfsstats.direofcache_misses =
- NFSD_VNET(nfsstatsv1_p)->direofcache_misses;
+ NFSD_VNET(nfsstatsv1).direofcache_misses;
oldnfsstats.accesscache_hits =
- NFSD_VNET(nfsstatsv1_p)->accesscache_hits;
+ NFSD_VNET(nfsstatsv1).accesscache_hits;
oldnfsstats.accesscache_misses =
- NFSD_VNET(nfsstatsv1_p)->accesscache_misses;
+ NFSD_VNET(nfsstatsv1).accesscache_misses;
oldnfsstats.biocache_reads =
- NFSD_VNET(nfsstatsv1_p)->biocache_reads;
+ NFSD_VNET(nfsstatsv1).biocache_reads;
oldnfsstats.read_bios =
- NFSD_VNET(nfsstatsv1_p)->read_bios;
+ NFSD_VNET(nfsstatsv1).read_bios;
oldnfsstats.read_physios =
- NFSD_VNET(nfsstatsv1_p)->read_physios;
+ NFSD_VNET(nfsstatsv1).read_physios;
oldnfsstats.biocache_writes =
- NFSD_VNET(nfsstatsv1_p)->biocache_writes;
+ NFSD_VNET(nfsstatsv1).biocache_writes;
oldnfsstats.write_bios =
- NFSD_VNET(nfsstatsv1_p)->write_bios;
+ NFSD_VNET(nfsstatsv1).write_bios;
oldnfsstats.write_physios =
- NFSD_VNET(nfsstatsv1_p)->write_physios;
+ NFSD_VNET(nfsstatsv1).write_physios;
oldnfsstats.biocache_readlinks =
- NFSD_VNET(nfsstatsv1_p)->biocache_readlinks;
+ NFSD_VNET(nfsstatsv1).biocache_readlinks;
oldnfsstats.readlink_bios =
- NFSD_VNET(nfsstatsv1_p)->readlink_bios;
+ NFSD_VNET(nfsstatsv1).readlink_bios;
oldnfsstats.biocache_readdirs =
- NFSD_VNET(nfsstatsv1_p)->biocache_readdirs;
+ NFSD_VNET(nfsstatsv1).biocache_readdirs;
oldnfsstats.readdir_bios =
- NFSD_VNET(nfsstatsv1_p)->readdir_bios;
+ NFSD_VNET(nfsstatsv1).readdir_bios;
for (i = 0; i < NFSV4_NPROCS; i++)
oldnfsstats.rpccnt[i] =
- NFSD_VNET(nfsstatsv1_p)->rpccnt[i];
+ NFSD_VNET(nfsstatsv1).rpccnt[i];
oldnfsstats.rpcretries =
- NFSD_VNET(nfsstatsv1_p)->rpcretries;
+ NFSD_VNET(nfsstatsv1).rpcretries;
for (i = 0; i < NFSV4OP_NOPS; i++)
oldnfsstats.srvrpccnt[i] =
- NFSD_VNET(nfsstatsv1_p)->srvrpccnt[i];
+ NFSD_VNET(nfsstatsv1).srvrpccnt[i];
for (i = NFSV42_NOPS, j = NFSV4OP_NOPS;
i < NFSV42_NOPS + NFSV4OP_FAKENOPS; i++, j++)
oldnfsstats.srvrpccnt[j] =
- NFSD_VNET(nfsstatsv1_p)->srvrpccnt[i];
+ NFSD_VNET(nfsstatsv1).srvrpccnt[i];
oldnfsstats.reserved_0 = 0;
oldnfsstats.reserved_1 = 0;
oldnfsstats.rpcrequests =
- NFSD_VNET(nfsstatsv1_p)->rpcrequests;
+ NFSD_VNET(nfsstatsv1).rpcrequests;
oldnfsstats.rpctimeouts =
- NFSD_VNET(nfsstatsv1_p)->rpctimeouts;
+ NFSD_VNET(nfsstatsv1).rpctimeouts;
oldnfsstats.rpcunexpected =
- NFSD_VNET(nfsstatsv1_p)->rpcunexpected;
+ NFSD_VNET(nfsstatsv1).rpcunexpected;
oldnfsstats.rpcinvalid =
- NFSD_VNET(nfsstatsv1_p)->rpcinvalid;
+ NFSD_VNET(nfsstatsv1).rpcinvalid;
oldnfsstats.srvcache_inproghits =
- NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits;
+ NFSD_VNET(nfsstatsv1).srvcache_inproghits;
oldnfsstats.reserved_2 = 0;
oldnfsstats.srvcache_nonidemdonehits =
- NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits;
+ NFSD_VNET(nfsstatsv1).srvcache_nonidemdonehits;
oldnfsstats.srvcache_misses =
- NFSD_VNET(nfsstatsv1_p)->srvcache_misses;
+ NFSD_VNET(nfsstatsv1).srvcache_misses;
oldnfsstats.srvcache_tcppeak =
- NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak;
+ NFSD_VNET(nfsstatsv1).srvcache_tcppeak;
oldnfsstats.srvcache_size =
- NFSD_VNET(nfsstatsv1_p)->srvcache_size;
+ NFSD_VNET(nfsstatsv1).srvcache_size;
oldnfsstats.srvclients =
- NFSD_VNET(nfsstatsv1_p)->srvclients;
+ NFSD_VNET(nfsstatsv1).srvclients;
oldnfsstats.srvopenowners =
- NFSD_VNET(nfsstatsv1_p)->srvopenowners;
+ NFSD_VNET(nfsstatsv1).srvopenowners;
oldnfsstats.srvopens =
- NFSD_VNET(nfsstatsv1_p)->srvopens;
+ NFSD_VNET(nfsstatsv1).srvopens;
oldnfsstats.srvlockowners =
- NFSD_VNET(nfsstatsv1_p)->srvlockowners;
+ NFSD_VNET(nfsstatsv1).srvlockowners;
oldnfsstats.srvlocks =
- NFSD_VNET(nfsstatsv1_p)->srvlocks;
+ NFSD_VNET(nfsstatsv1).srvlocks;
oldnfsstats.srvdelegates =
- NFSD_VNET(nfsstatsv1_p)->srvdelegates;
+ NFSD_VNET(nfsstatsv1).srvdelegates;
for (i = 0; i < NFSV4OP_CBNOPS; i++)
oldnfsstats.cbrpccnt[i] =
- NFSD_VNET(nfsstatsv1_p)->cbrpccnt[i];
+ NFSD_VNET(nfsstatsv1).cbrpccnt[i];
oldnfsstats.clopenowners =
- NFSD_VNET(nfsstatsv1_p)->clopenowners;
- oldnfsstats.clopens = NFSD_VNET(nfsstatsv1_p)->clopens;
+ NFSD_VNET(nfsstatsv1).clopenowners;
+ oldnfsstats.clopens = NFSD_VNET(nfsstatsv1).clopens;
oldnfsstats.cllockowners =
- NFSD_VNET(nfsstatsv1_p)->cllockowners;
- oldnfsstats.cllocks = NFSD_VNET(nfsstatsv1_p)->cllocks;
+ NFSD_VNET(nfsstatsv1).cllockowners;
+ oldnfsstats.cllocks = NFSD_VNET(nfsstatsv1).cllocks;
oldnfsstats.cldelegates =
- NFSD_VNET(nfsstatsv1_p)->cldelegates;
+ NFSD_VNET(nfsstatsv1).cldelegates;
oldnfsstats.cllocalopenowners =
- NFSD_VNET(nfsstatsv1_p)->cllocalopenowners;
+ NFSD_VNET(nfsstatsv1).cllocalopenowners;
oldnfsstats.cllocalopens =
- NFSD_VNET(nfsstatsv1_p)->cllocalopens;
+ NFSD_VNET(nfsstatsv1).cllocalopens;
oldnfsstats.cllocallockowners =
- NFSD_VNET(nfsstatsv1_p)->cllocallockowners;
+ NFSD_VNET(nfsstatsv1).cllocallockowners;
oldnfsstats.cllocallocks =
- NFSD_VNET(nfsstatsv1_p)->cllocallocks;
+ NFSD_VNET(nfsstatsv1).cllocallocks;
error = copyout(&oldnfsstats, uap->argp,
sizeof (oldnfsstats));
} else {
@@ -583,176 +582,177 @@
sizeof(nfsstatver));
if (error == 0) {
if (nfsstatver.vers == NFSSTATS_OV1) {
- /* Copy nfsstatsv1 to nfsstatsov1. */
+ /* Copy NFSD_VNET(nfsstatsv1) to nfsstatsov1. */
nfsstatsov1.attrcache_hits =
- NFSD_VNET(nfsstatsv1_p)->attrcache_hits;
+ NFSD_VNET(nfsstatsv1).attrcache_hits;
nfsstatsov1.attrcache_misses =
- NFSD_VNET(nfsstatsv1_p)->attrcache_misses;
+ NFSD_VNET(nfsstatsv1).attrcache_misses;
nfsstatsov1.lookupcache_hits =
- NFSD_VNET(nfsstatsv1_p)->lookupcache_hits;
+ NFSD_VNET(nfsstatsv1).lookupcache_hits;
nfsstatsov1.lookupcache_misses =
- NFSD_VNET(nfsstatsv1_p)->lookupcache_misses;
+ NFSD_VNET(nfsstatsv1).lookupcache_misses;
nfsstatsov1.direofcache_hits =
- NFSD_VNET(nfsstatsv1_p)->direofcache_hits;
+ NFSD_VNET(nfsstatsv1).direofcache_hits;
nfsstatsov1.direofcache_misses =
- NFSD_VNET(nfsstatsv1_p)->direofcache_misses;
+ NFSD_VNET(nfsstatsv1).direofcache_misses;
nfsstatsov1.accesscache_hits =
- NFSD_VNET(nfsstatsv1_p)->accesscache_hits;
+ NFSD_VNET(nfsstatsv1).accesscache_hits;
nfsstatsov1.accesscache_misses =
- NFSD_VNET(nfsstatsv1_p)->accesscache_misses;
+ NFSD_VNET(nfsstatsv1).accesscache_misses;
nfsstatsov1.biocache_reads =
- NFSD_VNET(nfsstatsv1_p)->biocache_reads;
+ NFSD_VNET(nfsstatsv1).biocache_reads;
nfsstatsov1.read_bios =
- NFSD_VNET(nfsstatsv1_p)->read_bios;
+ NFSD_VNET(nfsstatsv1).read_bios;
nfsstatsov1.read_physios =
- NFSD_VNET(nfsstatsv1_p)->read_physios;
+ NFSD_VNET(nfsstatsv1).read_physios;
nfsstatsov1.biocache_writes =
- NFSD_VNET(nfsstatsv1_p)->biocache_writes;
+ NFSD_VNET(nfsstatsv1).biocache_writes;
nfsstatsov1.write_bios =
- NFSD_VNET(nfsstatsv1_p)->write_bios;
+ NFSD_VNET(nfsstatsv1).write_bios;
nfsstatsov1.write_physios =
- NFSD_VNET(nfsstatsv1_p)->write_physios;
+ NFSD_VNET(nfsstatsv1).write_physios;
nfsstatsov1.biocache_readlinks =
- NFSD_VNET(nfsstatsv1_p)->biocache_readlinks;
+ NFSD_VNET(nfsstatsv1).biocache_readlinks;
nfsstatsov1.readlink_bios =
- NFSD_VNET(nfsstatsv1_p)->readlink_bios;
+ NFSD_VNET(nfsstatsv1).readlink_bios;
nfsstatsov1.biocache_readdirs =
- NFSD_VNET(nfsstatsv1_p)->biocache_readdirs;
+ NFSD_VNET(nfsstatsv1).biocache_readdirs;
nfsstatsov1.readdir_bios =
- NFSD_VNET(nfsstatsv1_p)->readdir_bios;
+ NFSD_VNET(nfsstatsv1).readdir_bios;
for (i = 0; i < NFSV42_OLDNPROCS; i++)
nfsstatsov1.rpccnt[i] =
- NFSD_VNET(nfsstatsv1_p)->rpccnt[i];
+ NFSD_VNET(nfsstatsv1).rpccnt[i];
nfsstatsov1.rpcretries =
- NFSD_VNET(nfsstatsv1_p)->rpcretries;
+ NFSD_VNET(nfsstatsv1).rpcretries;
for (i = 0; i < NFSV42_PURENOPS; i++)
nfsstatsov1.srvrpccnt[i] =
- NFSD_VNET(nfsstatsv1_p)->srvrpccnt[i];
+ NFSD_VNET(nfsstatsv1).srvrpccnt[i];
for (i = NFSV42_NOPS,
j = NFSV42_PURENOPS;
i < NFSV42_NOPS + NFSV4OP_FAKENOPS;
i++, j++)
nfsstatsov1.srvrpccnt[j] =
- NFSD_VNET(nfsstatsv1_p)->srvrpccnt[i];
+ NFSD_VNET(nfsstatsv1).srvrpccnt[i];
nfsstatsov1.reserved_0 = 0;
nfsstatsov1.reserved_1 = 0;
nfsstatsov1.rpcrequests =
- NFSD_VNET(nfsstatsv1_p)->rpcrequests;
+ NFSD_VNET(nfsstatsv1).rpcrequests;
nfsstatsov1.rpctimeouts =
- NFSD_VNET(nfsstatsv1_p)->rpctimeouts;
+ NFSD_VNET(nfsstatsv1).rpctimeouts;
nfsstatsov1.rpcunexpected =
- NFSD_VNET(nfsstatsv1_p)->rpcunexpected;
+ NFSD_VNET(nfsstatsv1).rpcunexpected;
nfsstatsov1.rpcinvalid =
- NFSD_VNET(nfsstatsv1_p)->rpcinvalid;
+ NFSD_VNET(nfsstatsv1).rpcinvalid;
nfsstatsov1.srvcache_inproghits =
- NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits;
+ NFSD_VNET(nfsstatsv1).srvcache_inproghits;
nfsstatsov1.reserved_2 = 0;
nfsstatsov1.srvcache_nonidemdonehits =
- NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits;
+ NFSD_VNET(nfsstatsv1).srvcache_nonidemdonehits;
nfsstatsov1.srvcache_misses =
- NFSD_VNET(nfsstatsv1_p)->srvcache_misses;
+ NFSD_VNET(nfsstatsv1).srvcache_misses;
nfsstatsov1.srvcache_tcppeak =
- NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak;
+ NFSD_VNET(nfsstatsv1).srvcache_tcppeak;
nfsstatsov1.srvcache_size =
- NFSD_VNET(nfsstatsv1_p)->srvcache_size;
+ NFSD_VNET(nfsstatsv1).srvcache_size;
nfsstatsov1.srvclients =
- NFSD_VNET(nfsstatsv1_p)->srvclients;
+ NFSD_VNET(nfsstatsv1).srvclients;
nfsstatsov1.srvopenowners =
- NFSD_VNET(nfsstatsv1_p)->srvopenowners;
+ NFSD_VNET(nfsstatsv1).srvopenowners;
nfsstatsov1.srvopens =
- NFSD_VNET(nfsstatsv1_p)->srvopens;
+ NFSD_VNET(nfsstatsv1).srvopens;
nfsstatsov1.srvlockowners =
- NFSD_VNET(nfsstatsv1_p)->srvlockowners;
+ NFSD_VNET(nfsstatsv1).srvlockowners;
nfsstatsov1.srvlocks =
- NFSD_VNET(nfsstatsv1_p)->srvlocks;
+ NFSD_VNET(nfsstatsv1).srvlocks;
nfsstatsov1.srvdelegates =
- NFSD_VNET(nfsstatsv1_p)->srvdelegates;
+ NFSD_VNET(nfsstatsv1).srvdelegates;
for (i = 0; i < NFSV42_CBNOPS; i++)
nfsstatsov1.cbrpccnt[i] =
- NFSD_VNET(nfsstatsv1_p)->cbrpccnt[i];
+ NFSD_VNET(nfsstatsv1).cbrpccnt[i];
nfsstatsov1.clopenowners =
- NFSD_VNET(nfsstatsv1_p)->clopenowners;
+ NFSD_VNET(nfsstatsv1).clopenowners;
nfsstatsov1.clopens =
- NFSD_VNET(nfsstatsv1_p)->clopens;
+ NFSD_VNET(nfsstatsv1).clopens;
nfsstatsov1.cllockowners =
- NFSD_VNET(nfsstatsv1_p)->cllockowners;
+ NFSD_VNET(nfsstatsv1).cllockowners;
nfsstatsov1.cllocks =
- NFSD_VNET(nfsstatsv1_p)->cllocks;
+ NFSD_VNET(nfsstatsv1).cllocks;
nfsstatsov1.cldelegates =
- NFSD_VNET(nfsstatsv1_p)->cldelegates;
+ NFSD_VNET(nfsstatsv1).cldelegates;
nfsstatsov1.cllocalopenowners =
- NFSD_VNET(nfsstatsv1_p)->cllocalopenowners;
+ NFSD_VNET(nfsstatsv1).cllocalopenowners;
nfsstatsov1.cllocalopens =
- NFSD_VNET(nfsstatsv1_p)->cllocalopens;
+ NFSD_VNET(nfsstatsv1).cllocalopens;
nfsstatsov1.cllocallockowners =
- NFSD_VNET(nfsstatsv1_p)->cllocallockowners;
+ NFSD_VNET(nfsstatsv1).cllocallockowners;
nfsstatsov1.cllocallocks =
- NFSD_VNET(nfsstatsv1_p)->cllocallocks;
+ NFSD_VNET(nfsstatsv1).cllocallocks;
nfsstatsov1.srvstartcnt =
- NFSD_VNET(nfsstatsv1_p)->srvstartcnt;
+ NFSD_VNET(nfsstatsv1).srvstartcnt;
nfsstatsov1.srvdonecnt =
- NFSD_VNET(nfsstatsv1_p)->srvdonecnt;
+ NFSD_VNET(nfsstatsv1).srvdonecnt;
for (i = NFSV42_NOPS,
j = NFSV42_PURENOPS;
i < NFSV42_NOPS + NFSV4OP_FAKENOPS;
i++, j++) {
nfsstatsov1.srvbytes[j] =
- NFSD_VNET(nfsstatsv1_p)->srvbytes[i];
+ NFSD_VNET(nfsstatsv1).srvbytes[i];
nfsstatsov1.srvops[j] =
- NFSD_VNET(nfsstatsv1_p)->srvops[i];
+ NFSD_VNET(nfsstatsv1).srvops[i];
nfsstatsov1.srvduration[j] =
- NFSD_VNET(nfsstatsv1_p)->srvduration[i];
+ NFSD_VNET(nfsstatsv1).srvduration[i];
}
nfsstatsov1.busyfrom =
- NFSD_VNET(nfsstatsv1_p)->busyfrom;
+ NFSD_VNET(nfsstatsv1).busyfrom;
nfsstatsov1.busyfrom =
- NFSD_VNET(nfsstatsv1_p)->busyfrom;
+ NFSD_VNET(nfsstatsv1).busyfrom;
error = copyout(&nfsstatsov1, uap->argp,
sizeof(nfsstatsov1));
} else if (nfsstatver.vers != NFSSTATS_V1)
error = EPERM;
else
- error = copyout(NFSD_VNET(nfsstatsv1_p),
- uap->argp, sizeof(nfsstatsv1));
+ error = copyout(&NFSD_VNET(nfsstatsv1),
+ uap->argp,
+ sizeof(struct nfsstatsv1));
}
}
if (error == 0) {
if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) {
- NFSD_VNET(nfsstatsv1_p)->attrcache_hits = 0;
- NFSD_VNET(nfsstatsv1_p)->attrcache_misses = 0;
- NFSD_VNET(nfsstatsv1_p)->lookupcache_hits = 0;
- NFSD_VNET(nfsstatsv1_p)->lookupcache_misses = 0;
- NFSD_VNET(nfsstatsv1_p)->direofcache_hits = 0;
- NFSD_VNET(nfsstatsv1_p)->direofcache_misses = 0;
- NFSD_VNET(nfsstatsv1_p)->accesscache_hits = 0;
- NFSD_VNET(nfsstatsv1_p)->accesscache_misses = 0;
- NFSD_VNET(nfsstatsv1_p)->biocache_reads = 0;
- NFSD_VNET(nfsstatsv1_p)->read_bios = 0;
- NFSD_VNET(nfsstatsv1_p)->read_physios = 0;
- NFSD_VNET(nfsstatsv1_p)->biocache_writes = 0;
- NFSD_VNET(nfsstatsv1_p)->write_bios = 0;
- NFSD_VNET(nfsstatsv1_p)->write_physios = 0;
- NFSD_VNET(nfsstatsv1_p)->biocache_readlinks = 0;
- NFSD_VNET(nfsstatsv1_p)->readlink_bios = 0;
- NFSD_VNET(nfsstatsv1_p)->biocache_readdirs = 0;
- NFSD_VNET(nfsstatsv1_p)->readdir_bios = 0;
- NFSD_VNET(nfsstatsv1_p)->rpcretries = 0;
- NFSD_VNET(nfsstatsv1_p)->rpcrequests = 0;
- NFSD_VNET(nfsstatsv1_p)->rpctimeouts = 0;
- NFSD_VNET(nfsstatsv1_p)->rpcunexpected = 0;
- NFSD_VNET(nfsstatsv1_p)->rpcinvalid = 0;
- bzero(NFSD_VNET(nfsstatsv1_p)->rpccnt,
- sizeof(NFSD_VNET(nfsstatsv1_p)->rpccnt));
+ NFSD_VNET(nfsstatsv1).attrcache_hits = 0;
+ NFSD_VNET(nfsstatsv1).attrcache_misses = 0;
+ NFSD_VNET(nfsstatsv1).lookupcache_hits = 0;
+ NFSD_VNET(nfsstatsv1).lookupcache_misses = 0;
+ NFSD_VNET(nfsstatsv1).direofcache_hits = 0;
+ NFSD_VNET(nfsstatsv1).direofcache_misses = 0;
+ NFSD_VNET(nfsstatsv1).accesscache_hits = 0;
+ NFSD_VNET(nfsstatsv1).accesscache_misses = 0;
+ NFSD_VNET(nfsstatsv1).biocache_reads = 0;
+ NFSD_VNET(nfsstatsv1).read_bios = 0;
+ NFSD_VNET(nfsstatsv1).read_physios = 0;
+ NFSD_VNET(nfsstatsv1).biocache_writes = 0;
+ NFSD_VNET(nfsstatsv1).write_bios = 0;
+ NFSD_VNET(nfsstatsv1).write_physios = 0;
+ NFSD_VNET(nfsstatsv1).biocache_readlinks = 0;
+ NFSD_VNET(nfsstatsv1).readlink_bios = 0;
+ NFSD_VNET(nfsstatsv1).biocache_readdirs = 0;
+ NFSD_VNET(nfsstatsv1).readdir_bios = 0;
+ NFSD_VNET(nfsstatsv1).rpcretries = 0;
+ NFSD_VNET(nfsstatsv1).rpcrequests = 0;
+ NFSD_VNET(nfsstatsv1).rpctimeouts = 0;
+ NFSD_VNET(nfsstatsv1).rpcunexpected = 0;
+ NFSD_VNET(nfsstatsv1).rpcinvalid = 0;
+ bzero(NFSD_VNET(nfsstatsv1).rpccnt,
+ sizeof(NFSD_VNET(nfsstatsv1).rpccnt));
}
if ((uap->flag & NFSSVC_ZEROSRVSTATS) != 0) {
- NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits = 0;
- NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits = 0;
- NFSD_VNET(nfsstatsv1_p)->srvcache_misses = 0;
- NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak = 0;
- bzero(NFSD_VNET(nfsstatsv1_p)->srvrpccnt,
- sizeof(NFSD_VNET(nfsstatsv1_p)->srvrpccnt));
- bzero(NFSD_VNET(nfsstatsv1_p)->cbrpccnt,
- sizeof(NFSD_VNET(nfsstatsv1_p)->cbrpccnt));
+ NFSD_VNET(nfsstatsv1).srvcache_inproghits = 0;
+ NFSD_VNET(nfsstatsv1).srvcache_nonidemdonehits = 0;
+ NFSD_VNET(nfsstatsv1).srvcache_misses = 0;
+ NFSD_VNET(nfsstatsv1).srvcache_tcppeak = 0;
+ bzero(NFSD_VNET(nfsstatsv1).srvrpccnt,
+ sizeof(NFSD_VNET(nfsstatsv1).srvrpccnt));
+ bzero(NFSD_VNET(nfsstatsv1).cbrpccnt,
+ sizeof(NFSD_VNET(nfsstatsv1).cbrpccnt));
}
}
goto out;
@@ -877,11 +877,6 @@
nfs_vnetinit(const void *unused __unused)
{
- if (IS_DEFAULT_VNET(curvnet))
- NFSD_VNET(nfsstatsv1_p) = &nfsstatsv1;
- else
- NFSD_VNET(nfsstatsv1_p) = malloc(sizeof(struct nfsstatsv1),
- M_TEMP, M_WAITOK | M_ZERO);
mtx_init(&NFSD_VNET(nfsrv_nfsuserdsock).nr_mtx, "nfsuserd",
NULL, MTX_DEF);
}
@@ -893,8 +888,6 @@
{
mtx_destroy(&NFSD_VNET(nfsrv_nfsuserdsock).nr_mtx);
- if (!IS_DEFAULT_VNET(curvnet))
- free(NFSD_VNET(nfsstatsv1_p), M_TEMP);
/* Clean out the name<-->id cache. */
nfsrv_cleanusergroup();
}
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -77,7 +77,6 @@
extern volatile int nfsrv_devidcnt;
extern int nfscl_debuglevel;
extern struct nfsdevicehead nfsrv_devidhead;
-extern struct nfsstatsv1 nfsstatsv1;
extern uint32_t nfs_srvmaxio;
NFSD_VNET_DEFINE(int, nfsd_enable_stringtouid) = 0;
@@ -470,7 +469,7 @@
(void) nfsm_fhtom(nd, nfhp, fhlen, 0);
}
if (procnum < NFSV42_NPROCS)
- NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[procnum]);
}
/*
diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h
--- a/sys/fs/nfs/nfsport.h
+++ b/sys/fs/nfs/nfsport.h
@@ -637,6 +637,9 @@
};
#ifdef _KERNEL
+
+NFSD_VNET_DECLARE(struct nfsstatsv1, nfsstatsv1);
+
/*
* Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code.
*/
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -62,7 +62,6 @@
#include <fs/nfsclient/nfs_kdtrace.h>
extern int newnfs_directio_allow_mmap;
-extern struct nfsstatsv1 nfsstatsv1;
extern struct mtx ncl_iod_mutex;
extern int ncl_numasync;
extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON];
@@ -481,7 +480,7 @@
switch (vp->v_type) {
case VREG:
- NFSINCRGLOBAL(nfsstatsv1.biocache_reads);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).biocache_reads);
lbn = uio->uio_offset / biosize;
on = uio->uio_offset - (lbn * biosize);
@@ -562,7 +561,7 @@
n = MIN((unsigned)(bcount - on), uio->uio_resid);
break;
case VLNK:
- NFSINCRGLOBAL(nfsstatsv1.biocache_readlinks);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).biocache_readlinks);
bp = nfs_getcacheblk(vp, (daddr_t)0, NFS_MAXPATHLEN, td);
if (!bp) {
error = newnfs_sigintr(nmp, td);
@@ -584,7 +583,7 @@
on = 0;
break;
case VDIR:
- NFSINCRGLOBAL(nfsstatsv1.biocache_readdirs);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).biocache_readdirs);
NFSLOCKNODE(np);
if (np->n_direofoffset
&& uio->uio_offset >= np->n_direofoffset) {
@@ -1082,7 +1081,7 @@
}
}
- NFSINCRGLOBAL(nfsstatsv1.biocache_writes);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).biocache_writes);
lbn = uio->uio_offset / biosize;
on = uio->uio_offset - (lbn * biosize);
n = MIN((unsigned)(biosize - on), uio->uio_resid);
@@ -1720,7 +1719,7 @@
switch (vp->v_type) {
case VREG:
uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE;
- NFSINCRGLOBAL(nfsstatsv1.read_bios);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).read_bios);
error = ncl_readrpc(vp, uiop, cr);
if (!error) {
@@ -1755,11 +1754,11 @@
break;
case VLNK:
uiop->uio_offset = (off_t)0;
- NFSINCRGLOBAL(nfsstatsv1.readlink_bios);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).readlink_bios);
error = ncl_readlinkrpc(vp, uiop, cr);
break;
case VDIR:
- NFSINCRGLOBAL(nfsstatsv1.readdir_bios);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).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);
@@ -1821,7 +1820,7 @@
+ bp->b_dirtyoff;
io.iov_base = (char *)bp->b_data + bp->b_dirtyoff;
uiop->uio_rw = UIO_WRITE;
- NFSINCRGLOBAL(nfsstatsv1.write_bios);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).write_bios);
if ((bp->b_flags & (B_ASYNC | B_NEEDCOMMIT | B_NOCACHE | B_CLUSTER)) == B_ASYNC)
iomode = NFSWRITE_UNSTABLE;
diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c
--- a/sys/fs/nfsclient/nfs_clcomsubs.c
+++ b/sys/fs/nfsclient/nfs_clcomsubs.c
@@ -43,7 +43,6 @@
*/
#include <fs/nfs/nfsport.h>
-extern struct nfsstatsv1 nfsstatsv1;
extern int ncl_mbuf_mlen;
extern enum vtype newnv2tov_type[8];
extern enum vtype nv34tov_type[8];
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -69,7 +69,6 @@
/*
* Global variables
*/
-extern struct nfsstatsv1 nfsstatsv1;
extern int nfs_numnfscbd;
extern struct timeval nfsboottime;
extern u_int32_t newnfs_false, newnfs_true;
@@ -6694,8 +6693,8 @@
nfscl_reqstart(nd, NFSPROC_READ, nmp, fhp->nfh_fh,
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers,
NULL);
- NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READ]);
- NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_READDS]);
+ NFSDECRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[NFSPROC_READ]);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[NFSPROC_READDS]);
NFSCL_DEBUG(4, "nfsrpc_readds: vers3\n");
}
NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED * 3);
@@ -6773,8 +6772,8 @@
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh,
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers,
NULL);
- NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]);
- NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]);
+ NFSDECRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[NFSPROC_WRITE]);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[NFSPROC_WRITEDS]);
NFSCL_DEBUG(4, "nfsrpc_writeds: vers3\n");
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 3 * NFSX_UNSIGNED);
}
@@ -6906,8 +6905,8 @@
nfscl_reqstart(nd, NFSPROC_WRITE, nmp, fhp->nfh_fh,
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers,
NULL);
- NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITE]);
- NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_WRITEDS]);
+ NFSDECRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[NFSPROC_WRITE]);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[NFSPROC_WRITEDS]);
NFSCL_DEBUG(4, "nfsrpc_writedsmir: vers3\n");
NFSM_BUILD(tl, uint32_t *, NFSX_HYPER + 3 * NFSX_UNSIGNED);
}
@@ -7132,8 +7131,8 @@
nfscl_reqstart(nd, NFSPROC_COMMIT, nmp, fhp->nfh_fh,
fhp->nfh_len, NULL, &dsp->nfsclds_sess, vers, minorvers,
NULL);
- NFSDECRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMIT]);
- NFSINCRGLOBAL(nfsstatsv1.rpccnt[NFSPROC_COMMITDS]);
+ NFSDECRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[NFSPROC_COMMIT]);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).rpccnt[NFSPROC_COMMITDS]);
}
NFSCL_DEBUG(4, "nfsrpc_commitds: vers=%d minvers=%d\n", vers,
minorvers);
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -85,7 +85,6 @@
/*
* Global variables
*/
-extern struct nfsstatsv1 nfsstatsv1;
extern struct nfsreqhead nfsd_reqq;
extern u_int32_t newnfs_false, newnfs_true;
extern int nfscl_debuglevel;
@@ -374,10 +373,10 @@
nowp->nfsow_defunct = 0;
nfscl_lockinit(&nowp->nfsow_rwlock);
if (dp != NULL) {
- nfsstatsv1.cllocalopenowners++;
+ NFSD_VNET(nfsstatsv1).cllocalopenowners++;
LIST_INSERT_HEAD(&dp->nfsdl_owner, nowp, nfsow_list);
} else {
- nfsstatsv1.clopenowners++;
+ NFSD_VNET(nfsstatsv1).clopenowners++;
LIST_INSERT_HEAD(&clp->nfsc_owner, nowp, nfsow_list);
}
owp = *owpp = nowp;
@@ -413,11 +412,11 @@
TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp,
nfsdl_list);
dp->nfsdl_timestamp = NFSD_MONOSEC + 120;
- nfsstatsv1.cllocalopens++;
+ NFSD_VNET(nfsstatsv1).cllocalopens++;
} else {
LIST_INSERT_HEAD(NFSCLOPENHASH(clp, fhp, fhlen),
nop, nfso_hash);
- nfsstatsv1.clopens++;
+ NFSD_VNET(nfsstatsv1).clopens++;
}
LIST_INSERT_HEAD(&owp->nfsow_open, nop, nfso_list);
*opp = nop;
@@ -477,7 +476,7 @@
LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, fhlen), dp,
nfsdl_hash);
dp->nfsdl_timestamp = NFSD_MONOSEC + 120;
- nfsstatsv1.cldelegates++;
+ NFSD_VNET(nfsstatsv1).cldelegates++;
nfscl_delegcnt++;
} else {
/*
@@ -1229,10 +1228,10 @@
LIST_INIT(&nlp->nfsl_lock);
if (donelocally) {
nlp->nfsl_open = NULL;
- nfsstatsv1.cllocallockowners++;
+ NFSD_VNET(nfsstatsv1).cllocallockowners++;
} else {
nlp->nfsl_open = op;
- nfsstatsv1.cllockowners++;
+ NFSD_VNET(nfsstatsv1).cllockowners++;
}
LIST_INSERT_HEAD(lhp, nlp, nfsl_list);
lp = nlp;
@@ -1571,9 +1570,9 @@
nfscl_freealllocks(&op->nfso_lock, local);
free(op, M_NFSCLOPEN);
if (local)
- nfsstatsv1.cllocalopens--;
+ NFSD_VNET(nfsstatsv1).cllocalopens--;
else
- nfsstatsv1.clopens--;
+ NFSD_VNET(nfsstatsv1).clopens--;
}
/*
@@ -1666,9 +1665,9 @@
NFSUNLOCKCLSTATE();
free(owp, M_NFSCLOWNER);
if (local)
- nfsstatsv1.cllocalopenowners--;
+ NFSD_VNET(nfsstatsv1).cllocalopenowners--;
else
- nfsstatsv1.clopenowners--;
+ NFSD_VNET(nfsstatsv1).clopenowners--;
}
/*
@@ -1699,9 +1698,9 @@
}
free(lp, M_NFSCLLOCKOWNER);
if (local)
- nfsstatsv1.cllocallockowners--;
+ NFSD_VNET(nfsstatsv1).cllocallockowners--;
else
- nfsstatsv1.cllockowners--;
+ NFSD_VNET(nfsstatsv1).cllockowners--;
}
/*
@@ -1714,9 +1713,9 @@
LIST_REMOVE(lop, nfslo_list);
free(lop, M_NFSCLLOCK);
if (local)
- nfsstatsv1.cllocallocks--;
+ NFSD_VNET(nfsstatsv1).cllocallocks--;
else
- nfsstatsv1.cllocks--;
+ NFSD_VNET(nfsstatsv1).cllocks--;
}
/*
@@ -1751,7 +1750,7 @@
LIST_REMOVE(dp, nfsdl_hash);
if (freeit)
free(dp, M_NFSCLDELEG);
- nfsstatsv1.cldelegates--;
+ NFSD_VNET(nfsstatsv1).cldelegates--;
nfscl_delegcnt--;
}
@@ -1829,8 +1828,8 @@
LIST_INSERT_HEAD(&towp->nfsow_open, op, nfso_list);
LIST_INSERT_HEAD(NFSCLOPENHASH(clp, op->nfso_fh,
op->nfso_fhlen), op, nfso_hash);
- nfsstatsv1.cllocalopens--;
- nfsstatsv1.clopens++;
+ NFSD_VNET(nfsstatsv1).cllocalopens--;
+ NFSD_VNET(nfsstatsv1).clopens++;
}
} else {
/* Just add the openowner to the client list */
@@ -1839,10 +1838,10 @@
LIST_INSERT_HEAD(&clp->nfsc_owner, owp, nfsow_list);
LIST_INSERT_HEAD(NFSCLOPENHASH(clp, op->nfso_fh,
op->nfso_fhlen), op, nfso_hash);
- nfsstatsv1.cllocalopenowners--;
- nfsstatsv1.clopenowners++;
- nfsstatsv1.cllocalopens--;
- nfsstatsv1.clopens++;
+ NFSD_VNET(nfsstatsv1).cllocalopenowners--;
+ NFSD_VNET(nfsstatsv1).clopenowners++;
+ NFSD_VNET(nfsstatsv1).cllocalopens--;
+ NFSD_VNET(nfsstatsv1).clopens++;
}
}
owp = nowp;
@@ -2560,9 +2559,9 @@
else
LIST_INSERT_AFTER(insert_lop, new_lop, nfslo_list);
if (local)
- nfsstatsv1.cllocallocks++;
+ NFSD_VNET(nfsstatsv1).cllocallocks++;
else
- nfsstatsv1.cllocks++;
+ NFSD_VNET(nfsstatsv1).cllocks++;
}
/*
@@ -2863,7 +2862,7 @@
LIST_REMOVE(dp, nfsdl_hash);
TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list);
nfscl_delegcnt--;
- nfsstatsv1.cldelegates--;
+ NFSD_VNET(nfsstatsv1).cldelegates--;
}
NFSLOCKCLSTATE();
/*
@@ -2920,7 +2919,7 @@
LIST_REMOVE(dp, nfsdl_hash);
TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list);
nfscl_delegcnt--;
- nfsstatsv1.cldelegates--;
+ NFSD_VNET(nfsstatsv1).cldelegates--;
}
}
dp = ndp;
@@ -3632,7 +3631,7 @@
break;
}
if (op < NFSV42_CBNOPS)
- nfsstatsv1.cbrpccnt[nd->nd_procnum]++;
+ NFSD_VNET(nfsstatsv1).cbrpccnt[nd->nd_procnum]++;
switch (op) {
case NFSV4OP_CBGETATTR:
NFSCL_DEBUG(4, "cbgetattr\n");
@@ -5254,7 +5253,7 @@
nfsly_hash);
lyp->nfsly_timestamp = NFSD_MONOSEC + 120;
nfscl_layoutcnt++;
- nfsstatsv1.cllayouts++;
+ NFSD_VNET(nfsstatsv1).cllayouts++;
} else {
if (retonclose != 0)
lyp->nfsly_flags |= NFSLY_RETONCLOSE;
@@ -5629,7 +5628,7 @@
free(rp, M_NFSLAYRECALL);
}
nfscl_layoutcnt--;
- nfsstatsv1.cllayouts--;
+ NFSD_VNET(nfsstatsv1).cllayouts--;
free(layp, M_NFSLAYOUT);
}
diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c
--- a/sys/fs/nfsclient/nfs_clsubs.c
+++ b/sys/fs/nfsclient/nfs_clsubs.c
@@ -84,7 +84,6 @@
extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON];
extern int ncl_numasync;
extern unsigned int ncl_iodmax;
-extern struct nfsstatsv1 nfsstatsv1;
struct task ncl_nfsiodnew_task;
@@ -225,12 +224,12 @@
if ((time_second - np->n_attrstamp) >= timeo &&
(mustflush != 0 || np->n_attrstamp == 0)) {
- nfsstatsv1.attrcache_misses++;
+ NFSD_VNET(nfsstatsv1).attrcache_misses++;
NFSUNLOCKNODE(np);
KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
return( ENOENT);
}
- nfsstatsv1.attrcache_hits++;
+ NFSD_VNET(nfsstatsv1).attrcache_hits++;
setnsize = false;
if (vap->va_size != np->n_size) {
if (vap->va_type == VREG) {
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -104,7 +104,6 @@
#define TRUE 1
#define FALSE 0
-extern struct nfsstatsv1 nfsstatsv1;
extern int nfsrv_useacl;
extern int nfscl_debuglevel;
MALLOC_DECLARE(M_NEWNFSREQ);
@@ -529,7 +528,7 @@
if (time_second < (np->n_accesscache[i].stamp
+ nfsaccess_cache_timeout) &&
(np->n_accesscache[i].mode & mode) == mode) {
- NFSINCRGLOBAL(nfsstatsv1.accesscache_hits);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).accesscache_hits);
gotahit = 1;
}
break;
@@ -548,7 +547,7 @@
/*
* Either a no, or a don't know. Go to the wire.
*/
- NFSINCRGLOBAL(nfsstatsv1.accesscache_misses);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).accesscache_misses);
error = nfs34_access_otw(vp, wmode, ap->a_td,
ap->a_cred, &rmode);
if (!error &&
@@ -1021,7 +1020,7 @@
if (NFS_ISV34(vp) && nfs_prime_access_cache &&
nfsaccess_cache_timeout > 0) {
- NFSINCRGLOBAL(nfsstatsv1.accesscache_misses);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).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);
@@ -1283,7 +1282,7 @@
((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(NFSD_VNET(nfsstatsv1).lookupcache_hits);
return (0);
}
cache_purge(newvp);
@@ -1307,7 +1306,7 @@
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(NFSD_VNET(nfsstatsv1).lookupcache_hits);
return (ENOENT);
}
cache_purge_negative(dvp);
@@ -1335,7 +1334,7 @@
NFSUNLOCKMNT(nmp);
newvp = NULLVP;
- NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).lookupcache_misses);
nanouptime(&ts);
error = nfsrpc_lookup(dvp, cnp->cn_nameptr, cnp->cn_namelen,
cnp->cn_cred, td, &dnfsva, &nfsva, &nfhp, &attrflag, &dattrflag,
@@ -2447,7 +2446,7 @@
if ((NFS_ISV4(vp) && np->n_change == vattr.va_filerev) ||
!NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) {
NFSUNLOCKNODE(np);
- NFSINCRGLOBAL(nfsstatsv1.direofcache_hits);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).direofcache_hits);
if (ap->a_eofflag != NULL)
*ap->a_eofflag = 1;
return (0);
@@ -2475,7 +2474,7 @@
error = ncl_bioread(vp, uio, 0, ap->a_cred);
if (!error && uio->uio_resid == tresid) {
- NFSINCRGLOBAL(nfsstatsv1.direofcache_misses);
+ NFSINCRGLOBAL(NFSD_VNET(nfsstatsv1).direofcache_misses);
if (ap->a_eofflag != NULL)
*ap->a_eofflag = 1;
}
diff --git a/sys/fs/nfsserver/nfs_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c
--- a/sys/fs/nfsserver/nfs_nfsdcache.c
+++ b/sys/fs/nfsserver/nfs_nfsdcache.c
@@ -165,7 +165,6 @@
NFSD_VNET_DECLARE(struct nfsrvhashhead *, nfsrvudphashtbl);
NFSD_VNET_DECLARE(struct nfsrchash_bucket *, nfsrchash_table);
NFSD_VNET_DECLARE(struct nfsrchash_bucket *, nfsrcahash_table);
-NFSD_VNET_DECLARE(struct nfsstatsv1 *, nfsstatsv1_p);
NFSD_VNET_DEFINE(int, nfsrc_floodlevel) = NFSRVCACHE_FLOODLEVEL;
NFSD_VNET_DEFINE(int, nfsrc_tcpsavedreplies) = 0;
@@ -404,14 +403,14 @@
TAILQ_REMOVE(&NFSD_VNET(nfsrvudplru), rp, rc_lru);
TAILQ_INSERT_TAIL(&NFSD_VNET(nfsrvudplru), rp, rc_lru);
if (rp->rc_flag & RC_INPROG) {
- NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits++;
+ NFSD_VNET(nfsstatsv1).srvcache_inproghits++;
mtx_unlock(mutex);
ret = RC_DROPIT;
} else if (rp->rc_flag & RC_REPSTATUS) {
/*
* V2 only.
*/
- NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++;
+ NFSD_VNET(nfsstatsv1).srvcache_nonidemdonehits++;
mtx_unlock(mutex);
nfsrvd_rephead(nd);
*(nd->nd_errp) = rp->rc_status;
@@ -419,7 +418,7 @@
rp->rc_timestamp = NFSD_MONOSEC +
NFSRVCACHE_UDPTIMEOUT;
} else if (rp->rc_flag & RC_REPMBUF) {
- NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++;
+ NFSD_VNET(nfsstatsv1).srvcache_nonidemdonehits++;
mtx_unlock(mutex);
nd->nd_mreq = m_copym(rp->rc_reply, 0,
M_COPYALL, M_WAITOK);
@@ -434,8 +433,8 @@
goto out;
}
}
- NFSD_VNET(nfsstatsv1_p)->srvcache_misses++;
- atomic_add_int(&NFSD_VNET(nfsstatsv1_p)->srvcache_size, 1);
+ NFSD_VNET(nfsstatsv1).srvcache_misses++;
+ atomic_add_int(&NFSD_VNET(nfsstatsv1).srvcache_size, 1);
NFSD_VNET(nfsrc_udpcachesize)++;
newrp->rc_flag |= RC_INPROG;
@@ -489,7 +488,7 @@
* Reply from cache is a special case returned by nfsrv_checkseqid().
*/
if (nd->nd_repstat == NFSERR_REPLYFROMCACHE) {
- NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++;
+ NFSD_VNET(nfsstatsv1).srvcache_nonidemdonehits++;
mtx_unlock(mutex);
nd->nd_repstat = 0;
if (nd->nd_mreq)
@@ -529,8 +528,8 @@
atomic_add_int(&NFSD_VNET(nfsrc_tcpsavedreplies),
1);
if (NFSD_VNET(nfsrc_tcpsavedreplies) >
- NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak)
- NFSD_VNET(nfsstatsv1_p)->srvcache_tcppeak =
+ NFSD_VNET(nfsstatsv1).srvcache_tcppeak)
+ NFSD_VNET(nfsstatsv1).srvcache_tcppeak =
NFSD_VNET(nfsrc_tcpsavedreplies);
}
mtx_unlock(mutex);
@@ -688,7 +687,7 @@
panic("nfs tcp cache0");
rp->rc_flag |= RC_LOCKED;
if (rp->rc_flag & RC_INPROG) {
- NFSD_VNET(nfsstatsv1_p)->srvcache_inproghits++;
+ NFSD_VNET(nfsstatsv1).srvcache_inproghits++;
mtx_unlock(mutex);
if (newrp->rc_sockref == rp->rc_sockref)
nfsrc_marksametcpconn(rp->rc_sockref);
@@ -697,7 +696,7 @@
/*
* V2 only.
*/
- NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++;
+ NFSD_VNET(nfsstatsv1).srvcache_nonidemdonehits++;
mtx_unlock(mutex);
if (newrp->rc_sockref == rp->rc_sockref)
nfsrc_marksametcpconn(rp->rc_sockref);
@@ -706,7 +705,7 @@
*(nd->nd_errp) = rp->rc_status;
rp->rc_timestamp = NFSD_MONOSEC + nfsrc_tcptimeout;
} else if (rp->rc_flag & RC_REPMBUF) {
- NFSD_VNET(nfsstatsv1_p)->srvcache_nonidemdonehits++;
+ NFSD_VNET(nfsstatsv1).srvcache_nonidemdonehits++;
mtx_unlock(mutex);
if (newrp->rc_sockref == rp->rc_sockref)
nfsrc_marksametcpconn(rp->rc_sockref);
@@ -721,8 +720,8 @@
free(newrp, M_NFSRVCACHE);
goto out;
}
- NFSD_VNET(nfsstatsv1_p)->srvcache_misses++;
- atomic_add_int(&NFSD_VNET(nfsstatsv1_p)->srvcache_size, 1);
+ NFSD_VNET(nfsstatsv1).srvcache_misses++;
+ atomic_add_int(&NFSD_VNET(nfsstatsv1).srvcache_size, 1);
/*
* For TCP, multiple entries for a key are allowed, so don't
@@ -811,7 +810,7 @@
atomic_add_int(&NFSD_VNET(nfsrc_tcpsavedreplies), -1);
}
free(rp, M_NFSRVCACHE);
- atomic_add_int(&NFSD_VNET(nfsstatsv1_p)->srvcache_size, -1);
+ atomic_add_int(&NFSD_VNET(nfsstatsv1).srvcache_size, -1);
}
/*
@@ -834,7 +833,7 @@
nfsrc_freecache(rp);
}
}
- NFSD_VNET(nfsstatsv1_p)->srvcache_size = 0;
+ NFSD_VNET(nfsstatsv1).srvcache_size = 0;
NFSD_VNET(nfsrc_tcpsavedreplies) = 0;
}
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -78,7 +78,6 @@
NFSD_VNET_DECLARE(struct nfslockhashhead *, nfslockhash);
NFSD_VNET_DECLARE(struct nfssessionhash *, nfssessionhash);
NFSD_VNET_DECLARE(struct nfsv4lock, nfsd_suspend_lock);
-NFSD_VNET_DECLARE(struct nfsstatsv1 *, nfsstatsv1_p);
NFSDLOCKMUTEX;
NFSSTATESPINLOCK;
@@ -1032,7 +1031,7 @@
nh = nfsrv_sequential_heuristic(uiop, vp);
ioflag |= nh->nh_seqcount << IO_SEQSHIFT;
/* XXX KDM make this more systematic? */
- NFSD_VNET(nfsstatsv1_p)->srvbytes[NFSV4OP_READ] += uiop->uio_resid;
+ NFSD_VNET(nfsstatsv1).srvbytes[NFSV4OP_READ] += uiop->uio_resid;
error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred);
free(iv, M_TEMP);
if (error) {
@@ -1157,7 +1156,7 @@
nh = nfsrv_sequential_heuristic(uiop, vp);
ioflags |= nh->nh_seqcount << IO_SEQSHIFT;
/* XXX KDM make this more systematic? */
- NFSD_VNET(nfsstatsv1_p)->srvbytes[NFSV4OP_WRITE] += uiop->uio_resid;
+ NFSD_VNET(nfsstatsv1).srvbytes[NFSV4OP_WRITE] += uiop->uio_resid;
error = VOP_WRITE(vp, uiop, ioflags, cred);
if (error == 0)
nh->nh_nextoff = uiop->uio_offset;
diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c
--- a/sys/fs/nfsserver/nfs_nfsdsocket.c
+++ b/sys/fs/nfsserver/nfs_nfsdsocket.c
@@ -58,7 +58,6 @@
NFSD_VNET_DECLARE(int, nfsrc_tcpsavedreplies);
NFSD_VNET_DECLARE(struct nfsrvfh, nfs_rootfh);
NFSD_VNET_DECLARE(int, nfs_rootfhset);
-NFSD_VNET_DECLARE(struct nfsstatsv1 *, nfsstatsv1_p);
int (*nfsrv3_procs0[NFS_V3NPROCS])(struct nfsrv_descript *,
int, vnode_t , struct nfsexstuff *) = {
@@ -475,16 +474,16 @@
}
mtx_lock(&nfsrvd_statmtx);
- if (NFSD_VNET(nfsstatsv1_p)->srvstartcnt ==
- NFSD_VNET(nfsstatsv1_p)->srvdonecnt) {
+ if (NFSD_VNET(nfsstatsv1).srvstartcnt ==
+ NFSD_VNET(nfsstatsv1).srvdonecnt) {
if (now != NULL)
- NFSD_VNET(nfsstatsv1_p)->busyfrom = *now;
+ NFSD_VNET(nfsstatsv1).busyfrom = *now;
else
- binuptime(&NFSD_VNET(nfsstatsv1_p)->busyfrom);
+ binuptime(&NFSD_VNET(nfsstatsv1).busyfrom);
}
- NFSD_VNET(nfsstatsv1_p)->srvrpccnt[op]++;
- NFSD_VNET(nfsstatsv1_p)->srvstartcnt++;
+ NFSD_VNET(nfsstatsv1).srvrpccnt[op]++;
+ NFSD_VNET(nfsstatsv1).srvstartcnt++;
mtx_unlock(&nfsrvd_statmtx);
}
@@ -507,21 +506,21 @@
mtx_lock(&nfsrvd_statmtx);
- NFSD_VNET(nfsstatsv1_p)->srvbytes[op] += bytes;
- NFSD_VNET(nfsstatsv1_p)->srvops[op]++;
+ NFSD_VNET(nfsstatsv1).srvbytes[op] += bytes;
+ NFSD_VNET(nfsstatsv1).srvops[op]++;
if (then != NULL) {
dt = *now;
bintime_sub(&dt, then);
- bintime_add(&NFSD_VNET(nfsstatsv1_p)->srvduration[op], &dt);
+ bintime_add(&NFSD_VNET(nfsstatsv1).srvduration[op], &dt);
}
dt = *now;
- bintime_sub(&dt, &NFSD_VNET(nfsstatsv1_p)->busyfrom);
- bintime_add(&NFSD_VNET(nfsstatsv1_p)->busytime, &dt);
- NFSD_VNET(nfsstatsv1_p)->busyfrom = *now;
+ bintime_sub(&dt, &NFSD_VNET(nfsstatsv1).busyfrom);
+ bintime_add(&NFSD_VNET(nfsstatsv1).busytime, &dt);
+ NFSD_VNET(nfsstatsv1).busyfrom = *now;
- NFSD_VNET(nfsstatsv1_p)->srvdonecnt++;
+ NFSD_VNET(nfsstatsv1).srvdonecnt++;
mtx_unlock(&nfsrvd_statmtx);
}
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -45,7 +45,6 @@
NFSD_VNET_DEFINE(struct nfsrv_stablefirst, nfsrv_stablefirst);
NFSD_VNET_DECLARE(int, nfsrv_numnfsd);
-NFSD_VNET_DECLARE(struct nfsstatsv1 *, nfsstatsv1_p);
extern uint32_t nfs_srvmaxio;
extern int nfsrv_lease;
@@ -363,7 +362,7 @@
LIST_INIT(&new_clp->lc_stateid[i]);
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
lc_hash);
- NFSD_VNET(nfsstatsv1_p)->srvclients++;
+ NFSD_VNET(nfsstatsv1).srvclients++;
nfsrv_openpluslock++;
nfsrv_clients++;
NFSLOCKV4ROOTMUTEX();
@@ -492,7 +491,7 @@
LIST_INIT(&new_clp->lc_session);
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
lc_hash);
- NFSD_VNET(nfsstatsv1_p)->srvclients++;
+ NFSD_VNET(nfsstatsv1).srvclients++;
nfsrv_openpluslock++;
nfsrv_clients++;
NFSLOCKV4ROOTMUTEX();
@@ -557,7 +556,7 @@
LIST_INIT(&new_clp->lc_session);
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp,
lc_hash);
- NFSD_VNET(nfsstatsv1_p)->srvclients++;
+ NFSD_VNET(nfsstatsv1).srvclients++;
nfsrv_openpluslock++;
nfsrv_clients++;
}
@@ -959,7 +958,7 @@
/*
* Dump out stats for all clients. Called from nfssvc(2), that is used
- * nfsstatsv1.
+ * NFSD_VNET(nfsstatsv1).
*/
void
nfsrv_dumpclients(struct nfsd_dumpclients *dumpp, int maxcnt)
@@ -1404,7 +1403,7 @@
free(clp->lc_stateid, M_NFSDCLIENT);
free(clp, M_NFSDCLIENT);
NFSLOCKSTATE();
- NFSD_VNET(nfsstatsv1_p)->srvclients--;
+ NFSD_VNET(nfsstatsv1).srvclients--;
nfsrv_openpluslock--;
nfsrv_clients--;
NFSUNLOCKSTATE();
@@ -1447,7 +1446,7 @@
nfsv4_testlock(&lfp->lf_locallock_lck) == 0)
nfsrv_freenfslockfile(lfp);
free(stp, M_NFSDSTATE);
- NFSD_VNET(nfsstatsv1_p)->srvdelegates--;
+ NFSD_VNET(nfsstatsv1).srvdelegates--;
nfsrv_openpluslock--;
nfsrv_delegatecnt--;
}
@@ -1473,7 +1472,7 @@
if (stp->ls_op)
nfsrvd_derefcache(stp->ls_op);
free(stp, M_NFSDSTATE);
- NFSD_VNET(nfsstatsv1_p)->srvopenowners--;
+ NFSD_VNET(nfsstatsv1).srvopenowners--;
nfsrv_openpluslock--;
}
@@ -1523,7 +1522,7 @@
if (cansleep != 0)
NFSUNLOCKSTATE();
free(stp, M_NFSDSTATE);
- NFSD_VNET(nfsstatsv1_p)->srvopens--;
+ NFSD_VNET(nfsstatsv1).srvopens--;
nfsrv_openpluslock--;
return (ret);
}
@@ -1542,7 +1541,7 @@
if (stp->ls_op)
nfsrvd_derefcache(stp->ls_op);
free(stp, M_NFSDSTATE);
- NFSD_VNET(nfsstatsv1_p)->srvlockowners--;
+ NFSD_VNET(nfsstatsv1).srvlockowners--;
nfsrv_openpluslock--;
}
@@ -1618,7 +1617,7 @@
if (lop->lo_lckfile.le_prev != NULL) {
LIST_REMOVE(lop, lo_lckfile);
- NFSD_VNET(nfsstatsv1_p)->srvlocks--;
+ NFSD_VNET(nfsstatsv1).srvlocks--;
nfsrv_openpluslock--;
}
LIST_REMOVE(lop, lo_lckowner);
@@ -2395,7 +2394,7 @@
LIST_INSERT_HEAD(&stp->ls_open, new_stp, ls_list);
*new_lopp = NULL;
*new_stpp = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvlockowners++;
+ NFSD_VNET(nfsstatsv1).srvlockowners++;
nfsrv_openpluslock++;
}
if (filestruct_locked != 0) {
@@ -3047,12 +3046,12 @@
LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list);
LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list);
*new_stpp = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvopenowners++;
+ NFSD_VNET(nfsstatsv1).srvopenowners++;
nfsrv_openpluslock++;
}
openstp = new_open;
new_open = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvopens++;
+ NFSD_VNET(nfsstatsv1).srvopens++;
nfsrv_openpluslock++;
break;
}
@@ -3113,7 +3112,7 @@
NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt) ||
!NFSVNO_DELEGOK(vp))
*rflagsp |= NFSV4OPEN_RECALL;
- NFSD_VNET(nfsstatsv1_p)->srvdelegates++;
+ NFSD_VNET(nfsstatsv1).srvdelegates++;
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
@@ -3153,12 +3152,12 @@
LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list);
LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list);
*new_stpp = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvopenowners++;
+ NFSD_VNET(nfsstatsv1).srvopenowners++;
nfsrv_openpluslock++;
}
openstp = new_open;
new_open = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvopens++;
+ NFSD_VNET(nfsstatsv1).srvopens++;
nfsrv_openpluslock++;
} else {
error = NFSERR_RECLAIMCONFLICT;
@@ -3230,7 +3229,7 @@
new_deleg->ls_stateid), new_deleg, ls_hash);
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list);
new_deleg = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvdelegates++;
+ NFSD_VNET(nfsstatsv1).srvdelegates++;
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
}
@@ -3252,7 +3251,7 @@
new_open, ls_hash);
openstp = new_open;
new_open = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvopens++;
+ NFSD_VNET(nfsstatsv1).srvopens++;
nfsrv_openpluslock++;
/*
@@ -3300,7 +3299,7 @@
new_deleg->ls_stateid), new_deleg, ls_hash);
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list);
new_deleg = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvdelegates++;
+ NFSD_VNET(nfsstatsv1).srvdelegates++;
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
}
@@ -3381,7 +3380,7 @@
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg,
ls_list);
new_deleg = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvdelegates++;
+ NFSD_VNET(nfsstatsv1).srvdelegates++;
nfsrv_openpluslock++;
nfsrv_delegatecnt++;
}
@@ -3409,9 +3408,9 @@
openstp = new_open;
new_open = NULL;
*new_stpp = NULL;
- NFSD_VNET(nfsstatsv1_p)->srvopens++;
+ NFSD_VNET(nfsstatsv1).srvopens++;
nfsrv_openpluslock++;
- NFSD_VNET(nfsstatsv1_p)->srvopenowners++;
+ NFSD_VNET(nfsstatsv1).srvopenowners++;
nfsrv_openpluslock++;
}
if (!error) {
@@ -3887,7 +3886,7 @@
else
LIST_INSERT_AFTER(insert_lop, new_lop, lo_lckowner);
if (stp != NULL) {
- NFSD_VNET(nfsstatsv1_p)->srvlocks++;
+ NFSD_VNET(nfsstatsv1).srvlocks++;
nfsrv_openpluslock++;
}
}
@@ -7455,7 +7454,7 @@
/* Insert the new layout in the lists. */
*lypp = NULL;
atomic_add_int(&nfsrv_layoutcnt, 1);
- NFSD_VNET(nfsstatsv1_p)->srvlayouts++;
+ NFSD_VNET(nfsstatsv1).srvlayouts++;
NFSBCOPY(lyp->lay_xdr, layp, lyp->lay_layoutlen);
*layoutlenp = lyp->lay_layoutlen;
TAILQ_INSERT_HEAD(&lhyp->list, lyp, lay_list);
@@ -7548,7 +7547,7 @@
NFSD_DEBUG(4, "Freelayout=%p\n", lyp);
atomic_add_int(&nfsrv_layoutcnt, -1);
- NFSD_VNET(nfsstatsv1_p)->srvlayouts--;
+ NFSD_VNET(nfsstatsv1).srvlayouts--;
TAILQ_REMOVE(lhp, lyp, lay_list);
free(lyp, M_NFSDSTATE);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 4:02 AM (21 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14729852
Default Alt Text
D38743.diff (49 KB)
Attached To
Mode
D38743: nfsd: properly virtualize nfsstatsv1
Attached
Detach File
Event Timeline
Log In to Comment