nfs: Mark unused statistics variable as reserved

FreeBSD's NFS exporter has long exported some unused statistics fields.
Revision r366992 removed them from nfsstat. This revision renames those
fields in the kernel's exported structures to make it clear to other
consumers that they are unused.

Reported by:	emaste
Reviewed by:	emaste
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D27258
This commit is contained in:
Alan Somers 2020-11-18 04:35:49 +00:00
parent cf770ba3e9
commit ac8c4a61af
3 changed files with 18 additions and 25 deletions

View File

@ -541,16 +541,15 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
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.reserved_0 = 0;
oldnfsstats.reserved_1 = 0;
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.reserved_2 = 0;
oldnfsstats.srvcache_nonidemdonehits =
nfsstatsv1.srvcache_nonidemdonehits;
oldnfsstats.srvcache_misses =
@ -636,10 +635,8 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
i++, j++)
nfsstatsov1.srvrpccnt[j] =
nfsstatsv1.srvrpccnt[i];
nfsstatsov1.srvrpc_errs =
nfsstatsv1.srvrpc_errs;
nfsstatsov1.srv_errs =
nfsstatsv1.srv_errs;
nfsstatsov1.reserved_0 = 0;
nfsstatsov1.reserved_1 = 0;
nfsstatsov1.rpcrequests =
nfsstatsv1.rpcrequests;
nfsstatsov1.rpctimeouts =
@ -650,8 +647,7 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
nfsstatsv1.rpcinvalid;
nfsstatsov1.srvcache_inproghits =
nfsstatsv1.srvcache_inproghits;
nfsstatsov1.srvcache_idemdonehits =
nfsstatsv1.srvcache_idemdonehits;
nfsstatsov1.reserved_2 = 0;
nfsstatsov1.srvcache_nonidemdonehits =
nfsstatsv1.srvcache_nonidemdonehits;
nfsstatsov1.srvcache_misses =
@ -750,10 +746,7 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
sizeof(nfsstatsv1.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;

View File

@ -447,14 +447,14 @@ struct nfsstatsv1 {
uint64_t rpccnt[NFSV42_NPROCS + 15];
uint64_t rpcretries;
uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15];
uint64_t srvrpc_errs;
uint64_t srv_errs;
uint64_t reserved_0;
uint64_t reserved_1;
uint64_t rpcrequests;
uint64_t rpctimeouts;
uint64_t rpcunexpected;
uint64_t rpcinvalid;
uint64_t srvcache_inproghits;
uint64_t srvcache_idemdonehits;
uint64_t reserved_2;
uint64_t srvcache_nonidemdonehits;
uint64_t srvcache_misses;
uint64_t srvcache_tcppeak;
@ -512,14 +512,14 @@ struct nfsstatsov1 {
uint64_t rpccnt[NFSV42_NPROCS + 4];
uint64_t rpcretries;
uint64_t srvrpccnt[NFSV42_PURENOPS + NFSV4OP_FAKENOPS];
uint64_t srvrpc_errs;
uint64_t srv_errs;
uint64_t reserved_0;
uint64_t reserved_1;
uint64_t rpcrequests;
uint64_t rpctimeouts;
uint64_t rpcunexpected;
uint64_t rpcinvalid;
uint64_t srvcache_inproghits;
uint64_t srvcache_idemdonehits;
uint64_t reserved_2;
uint64_t srvcache_nonidemdonehits;
uint64_t srvcache_misses;
uint64_t srvcache_tcppeak;
@ -574,14 +574,14 @@ struct ext_nfsstats {
int rpccnt[NFSV4_NPROCS];
int rpcretries;
int srvrpccnt[NFSV4OP_NOPS + NFSV4OP_FAKENOPS];
int srvrpc_errs;
int srv_errs;
int reserved_0;
int reserved_1;
int rpcrequests;
int rpctimeouts;
int rpcunexpected;
int rpcinvalid;
int srvcache_inproghits;
int srvcache_idemdonehits;
int reserved_2;
int srvcache_nonidemdonehits;
int srvcache_misses;
int srvcache_tcppeak;

View File

@ -42,10 +42,10 @@
* Server stats structure
*/
struct nfsrvstats {
int srvrpc_errs;
int srv_errs;
int reserved_0;
int reserved_1;
int srvcache_inproghits;
int srvcache_idemdonehits;
int reserved_2;
int srvcache_nonidemdonehits;
int srvcache_misses;
int srvvop_writes;