should I use a SYSCTL_STRUCT?

Rick Macklem rmacklem at uoguelph.ca
Fri Apr 29 20:42:11 UTC 2011


Hi,

I am at the point where I need to fix the "-z" option of
nfsstat. Currently the stats are acquired/zeroed for the
old NFS subsystem via sysctl. The setup in the kernel is:

SYSCTL_STRUCT(_vfs_nfs, NFS_NFSSTATS, nfsstats, CTLFLAG_RW,
	&nfsstats, nfsstats, "S,nfsstats");

The new NFS subsystem currently gets the contents of the
structure via a flag on nfssvc(2).

So, I could either:
- add another flag for nfssvc(2) to zero the structure
OR
- switch the new NFS subsystem over to using a SYSCTL_STRUCT()
  like the above.

Which do you think would be preferable?

Thanks in advance for any info, rick
ps: I got completely lost on the SYSCTL thread in Jan. and
    would rather not start another one like it:-)



More information about the freebsd-hackers mailing list