svn commit: r184561 - in head/sys: nfsclient nfsserver

Tom Rhodes trhodes at FreeBSD.org
Sun Nov 2 09:00:23 PST 2008


Author: trhodes
Date: Sun Nov  2 17:00:23 2008
New Revision: 184561
URL: http://svn.freebsd.org/changeset/base/184561

Log:
  Document a few sysctls in the NFS client and server code.
  Minor style(9) where applicable.
  
  Approved by:	alfred (slightly older version)

Modified:
  head/sys/nfsclient/nfs_nfsiod.c
  head/sys/nfsclient/nfs_socket.c
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/nfsserver/nfs_serv.c
  head/sys/nfsserver/nfs_syscalls.c

Modified: head/sys/nfsclient/nfs_nfsiod.c
==============================================================================
--- head/sys/nfsclient/nfs_nfsiod.c	Sun Nov  2 16:51:57 2008	(r184560)
+++ head/sys/nfsclient/nfs_nfsiod.c	Sun Nov  2 17:00:23 2008	(r184561)
@@ -84,7 +84,8 @@ SYSCTL_DECL(_vfs_nfs);
 
 /* Maximum number of seconds a nfsiod kthread will sleep before exiting */
 static unsigned int nfs_iodmaxidle = 120;
-SYSCTL_UINT(_vfs_nfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, &nfs_iodmaxidle, 0, "");
+SYSCTL_UINT(_vfs_nfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, &nfs_iodmaxidle, 0,
+    "Max number of seconds an nfsiod kthread will sleep before exiting");
 
 /* Maximum number of nfsiod kthreads */
 unsigned int nfs_iodmax = 20;
@@ -121,7 +122,8 @@ out:
 	return (0);
 }
 SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0,
-    sizeof (nfs_iodmin), sysctl_iodmin, "IU", "");
+    sizeof (nfs_iodmin), sysctl_iodmin, "IU",
+    "Min number of nfsiod kthreads to keep as spares");
 
 
 static int
@@ -157,7 +159,8 @@ out:
 	return (0);
 }
 SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0,
-    sizeof (nfs_iodmax), sysctl_iodmax, "IU", "");
+    sizeof (nfs_iodmax), sysctl_iodmax, "IU",
+    "Max number of nfsiod kthreads");
 
 int
 nfs_nfsiodnew(void)
@@ -208,7 +211,8 @@ nfsiod_setup(void *dummy)
 SYSINIT(nfsiod, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, nfsiod_setup, NULL);
 
 static int nfs_defect = 0;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0, "");
+SYSCTL_INT(_vfs_nfs, OID_AUTO, defect, CTLFLAG_RW, &nfs_defect, 0,
+    "Allow nfsiods to migrate serving different mounts");
 
 /*
  * Asynchronous I/O daemons for client nfs.

Modified: head/sys/nfsclient/nfs_socket.c
==============================================================================
--- head/sys/nfsclient/nfs_socket.c	Sun Nov  2 16:51:57 2008	(r184560)
+++ head/sys/nfsclient/nfs_socket.c	Sun Nov  2 17:00:23 2008	(r184561)
@@ -87,14 +87,18 @@ static int	fake_wchan;
 
 SYSCTL_DECL(_vfs_nfs);
 
-SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, 0, "");
-SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, 0, "");
-SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0, "");
+SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, 0,
+    "Number of realign tests done");
+SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, 0,
+    "Number of mbuf realignments done");
+SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, &nfs_bufpackets, 0,
+    "Buffer reservation size 2 < x < 64");
 SYSCTL_INT(_vfs_nfs, OID_AUTO, reconnects, CTLFLAG_RD, &nfs_reconnects, 0,
-    "number of times the nfs client has had to reconnect");
+    "Number of times the nfs client has had to reconnect");
 SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, &nfs3_jukebox_delay, 0,
-	   "number of seconds to delay a retry after receiving EJUKEBOX");
-SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0, "");
+    "Number of seconds to delay a retry after receiving EJUKEBOX");
+SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0,
+    "Disable weak cache consistency checking when server returns an error");
 
 /*
  * There is a congestion window for outstanding rpcs maintained per mount

Modified: head/sys/nfsclient/nfs_subs.c
==============================================================================
--- head/sys/nfsclient/nfs_subs.c	Sun Nov  2 16:51:57 2008	(r184560)
+++ head/sys/nfsclient/nfs_subs.c	Sun Nov  2 17:00:23 2008	(r184561)
@@ -730,7 +730,8 @@ nfs_loadattrcache(struct vnode **vpp, st
 #include <sys/sysctl.h>
 SYSCTL_DECL(_vfs_nfs);
 static int nfs_acdebug;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0, "");
+SYSCTL_INT(_vfs_nfs, OID_AUTO, acdebug, CTLFLAG_RW, &nfs_acdebug, 0,
+    "Toggle acdebug (access cache debug) flag");
 #endif
 
 /*

Modified: head/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- head/sys/nfsclient/nfs_vfsops.c	Sun Nov  2 16:51:57 2008	(r184560)
+++ head/sys/nfsclient/nfs_vfsops.c	Sun Nov  2 17:00:23 2008	(r184561)
@@ -92,18 +92,22 @@ SYSCTL_STRUCT(_vfs_nfs, NFS_NFSSTATS, nf
 	&nfsstats, nfsstats, "S,nfsstats");
 static int nfs_ip_paranoia = 1;
 SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_ip_paranoia, CTLFLAG_RW,
-    &nfs_ip_paranoia, 0, "");
+    &nfs_ip_paranoia, 0,
+    "Disallow accepting replies from IPs which differ from those sent");
 #ifdef NFS_DEBUG
 int nfs_debug;
-SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0, "");
+SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0,
+    "Toggle debug flag");
 #endif
 static int nfs_tprintf_initial_delay = NFS_TPRINTF_INITIAL_DELAY;
 SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_INITIAL_DELAY,
-        downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0, "");
+    downdelayinitial, CTLFLAG_RW, &nfs_tprintf_initial_delay, 0,
+    "Delay before printing \"nfs server not responding\" messages");
 /* how long between console messages "nfs server foo not responding" */
 static int nfs_tprintf_delay = NFS_TPRINTF_DELAY;
 SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_DELAY,
-        downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "");
+    downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0,
+    "Delay between printing \"nfs server not responding\" messages");
 
 static void	nfs_decode_args(struct mount *mp, struct nfsmount *nmp,
 		    struct nfs_args *argp, const char *hostname);
@@ -158,14 +162,15 @@ struct nfsv3_diskless nfsv3_diskless = {
 int nfs_diskless_valid = 0;
 
 SYSCTL_INT(_vfs_nfs, OID_AUTO, diskless_valid, CTLFLAG_RD,
-	&nfs_diskless_valid, 0, "");
+    &nfs_diskless_valid, 0,
+    "Has the diskless struct been filled correctly");
 
 SYSCTL_STRING(_vfs_nfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD,
-	nfsv3_diskless.root_hostnam, 0, "");
+    nfsv3_diskless.root_hostnam, 0, "Path to nfs root");
 
 SYSCTL_OPAQUE(_vfs_nfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD,
-	&nfsv3_diskless.root_saddr, sizeof nfsv3_diskless.root_saddr,
-	"%Ssockaddr_in", "");
+    &nfsv3_diskless.root_saddr, sizeof nfsv3_diskless.root_saddr,
+    "%Ssockaddr_in", "Diskless root nfs address");
 
 
 void		nfsargs_ntoh(struct nfs_args *);

Modified: head/sys/nfsserver/nfs_serv.c
==============================================================================
--- head/sys/nfsserver/nfs_serv.c	Sun Nov  2 16:51:57 2008	(r184560)
+++ head/sys/nfsserver/nfs_serv.c	Sun Nov  2 17:00:23 2008	(r184561)
@@ -130,8 +130,10 @@ SYSCTL_NODE(_vfs, OID_AUTO, nfsrv, CTLFL
 static int nfs_async;
 static int nfs_commit_blks;
 static int nfs_commit_miss;
-SYSCTL_INT(_vfs_nfsrv, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, "");
-SYSCTL_INT(_vfs_nfsrv, OID_AUTO, commit_blks, CTLFLAG_RW, &nfs_commit_blks, 0, "");
+SYSCTL_INT(_vfs_nfsrv, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0,
+    "Tell client that writes were synced even though they were not");
+SYSCTL_INT(_vfs_nfsrv, OID_AUTO, commit_blks, CTLFLAG_RW, &nfs_commit_blks, 0,
+    "Number of completed commits");
 SYSCTL_INT(_vfs_nfsrv, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, 0, "");
 
 struct nfsrvstats nfsrvstats;

Modified: head/sys/nfsserver/nfs_syscalls.c
==============================================================================
--- head/sys/nfsserver/nfs_syscalls.c	Sun Nov  2 16:51:57 2008	(r184560)
+++ head/sys/nfsserver/nfs_syscalls.c	Sun Nov  2 17:00:23 2008	(r184561)
@@ -89,11 +89,14 @@ static int	notstarted = 1;
 
 static int	nfs_privport = 0;
 SYSCTL_INT(_vfs_nfsrv, NFS_NFSPRIVPORT, nfs_privport, CTLFLAG_RW,
-	    &nfs_privport, 0, "");
+    &nfs_privport, 0,
+    "Only allow clients using a privileged port");
 SYSCTL_INT(_vfs_nfsrv, OID_AUTO, gatherdelay, CTLFLAG_RW,
-	    &nfsrvw_procrastinate, 0, "");
+    &nfsrvw_procrastinate, 0,
+    "Delay value for write gathering");
 SYSCTL_INT(_vfs_nfsrv, OID_AUTO, gatherdelay_v3, CTLFLAG_RW,
-	    &nfsrvw_procrastinate_v3, 0, "");
+    &nfsrvw_procrastinate_v3, 0,
+    "Delay in seconds for NFSv3 write gathering");
 
 static int	nfssvc_addsock(struct file *, struct sockaddr *);
 static void	nfsrv_zapsock(struct nfssvc_sock *slp);


More information about the svn-src-all mailing list