lockd: discard nlmsvc_timeout
authorNeilBrown <neilb@suse.de>
Mon, 15 Jul 2024 07:14:14 +0000 (17:14 +1000)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 1 Sep 2024 14:04:56 +0000 (10:04 -0400)
nlmsvc_timeout always has the same value as (nlm_timeout * HZ), so use
that in the one place that nlmsvc_timeout is used.

In truth it *might* not always be the same as nlmsvc_timeout is only set
when lockd is started while nlm_timeout can be set at anytime via
sysctl.  I think this difference it not helpful so removing it is good.

Also remove the test for nlm_timout being 0.  This is not possible -
unless a module parameter is used to set the minimum timeout to 0, and
if that happens then it probably should be honoured.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/host.c
fs/lockd/svc.c
include/linux/lockd/lockd.h

index c115168017845a4dc43492a991f5699769d36400..5e6877c37f7303e7141fbb96bc278a207c8e5ddc 100644 (file)
@@ -440,7 +440,7 @@ nlm_bind_host(struct nlm_host *host)
        if ((clnt = host->h_rpcclnt) != NULL) {
                nlm_rebind_host(host);
        } else {
-               unsigned long increment = nlmsvc_timeout;
+               unsigned long increment = nlm_timeout * HZ;
                struct rpc_timeout timeparms = {
                        .to_initval     = increment,
                        .to_increment   = increment,
index ab8042a5b895bc42a0ba9405c403de4ab90ae4d8..71713309967d3b7de19da9ab58951878c4add78f 100644 (file)
@@ -53,7 +53,6 @@ EXPORT_SYMBOL_GPL(nlmsvc_ops);
 static DEFINE_MUTEX(nlmsvc_mutex);
 static unsigned int            nlmsvc_users;
 static struct svc_serv         *nlmsvc_serv;
-unsigned long                  nlmsvc_timeout;
 
 static void nlmsvc_request_retry(struct timer_list *tl)
 {
@@ -68,7 +67,7 @@ unsigned int lockd_net_id;
  * and also changed through the sysctl interface.  -- Jamie Lokier, Aug 2003
  */
 static unsigned long           nlm_grace_period;
-static unsigned long           nlm_timeout = LOCKD_DFLT_TIMEO;
+unsigned long                  nlm_timeout = LOCKD_DFLT_TIMEO;
 static int                     nlm_udpport, nlm_tcpport;
 
 /* RLIM_NOFILE defaults to 1024. That seems like a reasonable default here. */
@@ -333,10 +332,6 @@ static int lockd_get(void)
                printk(KERN_WARNING
                        "lockd_up: no pid, %d users??\n", nlmsvc_users);
 
-       if (!nlm_timeout)
-               nlm_timeout = LOCKD_DFLT_TIMEO;
-       nlmsvc_timeout = nlm_timeout * HZ;
-
        serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, lockd);
        if (!serv) {
                printk(KERN_WARNING "lockd_up: create service failed\n");
index 1b95fe31051ff393084d622b03c7ff7746f75700..61c4b9c419042fede75dcd569b41386491fe3299 100644 (file)
@@ -200,7 +200,7 @@ extern const struct svc_procedure nlmsvc_procedures[24];
 extern const struct svc_procedure nlmsvc_procedures4[24];
 #endif
 extern int                     nlmsvc_grace_period;
-extern unsigned long           nlmsvc_timeout;
+extern unsigned long           nlm_timeout;
 extern bool                    nsm_use_hostnames;
 extern u32                     nsm_local_state;