[PATCH 1/2] knfsd: nfsd_max_connections module parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Decouple the maximum number of nfs client connections from the number of server
threads by adding the nfsd_max_connections module parameter.  Note that the
default remains the current formula: (nr_threads+3) * 20.

Signed-off-by: Ben Myers <bpm@xxxxxxx>
---
 fs/nfsd/nfsctl.c |    6 ++++++
 fs/nfsd/nfssvc.c |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 0f0e77f..981366d 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -16,6 +16,9 @@
 #include "nfsd.h"
 #include "cache.h"
 
+/* Default to use existing settings in svc_check_conn_limits */
+unsigned int nfsd_max_connections = 0;
+
 /*
  *	We have a single directory with 9 nodes in it.
  */
@@ -1447,5 +1450,8 @@ static void __exit exit_nfsd(void)
 
 MODULE_AUTHOR("Olaf Kirch <okir@xxxxxxxxxxxx>");
 MODULE_LICENSE("GPL");
+
+module_param(nfsd_max_connections, uint, 0644);
+
 module_init(init_nfsd)
 module_exit(exit_nfsd)
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 171699e..a21fd4e 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -275,11 +275,14 @@ int nfsd_create_serv(void)
 	return err;
 }
 
+extern unsigned int nfsd_max_connections;
 static int nfsd_init_socks(int port)
 {
 	int error;
 	if (!list_empty(&nfsd_serv->sv_permsocks))
 		return 0;
+	
+	nfsd_serv->sv_maxconn = nfsd_max_connections;
 
 	error = svc_create_xprt(nfsd_serv, "udp", PF_INET, port,
 					SVC_SOCK_DEFAULTS);

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux