Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lockd: discard nlmsvc_timeout

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>

authored by

NeilBrown and committed by
Chuck Lever
4ed9ef32 8203ab8a

+3 -8
+1 -1
fs/lockd/host.c
··· 440 440 if ((clnt = host->h_rpcclnt) != NULL) { 441 441 nlm_rebind_host(host); 442 442 } else { 443 - unsigned long increment = nlmsvc_timeout; 443 + unsigned long increment = nlm_timeout * HZ; 444 444 struct rpc_timeout timeparms = { 445 445 .to_initval = increment, 446 446 .to_increment = increment,
+1 -6
fs/lockd/svc.c
··· 53 53 static DEFINE_MUTEX(nlmsvc_mutex); 54 54 static unsigned int nlmsvc_users; 55 55 static struct svc_serv *nlmsvc_serv; 56 - unsigned long nlmsvc_timeout; 57 56 58 57 static void nlmsvc_request_retry(struct timer_list *tl) 59 58 { ··· 67 68 * and also changed through the sysctl interface. -- Jamie Lokier, Aug 2003 68 69 */ 69 70 static unsigned long nlm_grace_period; 70 - static unsigned long nlm_timeout = LOCKD_DFLT_TIMEO; 71 + unsigned long nlm_timeout = LOCKD_DFLT_TIMEO; 71 72 static int nlm_udpport, nlm_tcpport; 72 73 73 74 /* RLIM_NOFILE defaults to 1024. That seems like a reasonable default here. */ ··· 331 332 if (nlmsvc_users) 332 333 printk(KERN_WARNING 333 334 "lockd_up: no pid, %d users??\n", nlmsvc_users); 334 - 335 - if (!nlm_timeout) 336 - nlm_timeout = LOCKD_DFLT_TIMEO; 337 - nlmsvc_timeout = nlm_timeout * HZ; 338 335 339 336 serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, lockd); 340 337 if (!serv) {
+1 -1
include/linux/lockd/lockd.h
··· 200 200 extern const struct svc_procedure nlmsvc_procedures4[24]; 201 201 #endif 202 202 extern int nlmsvc_grace_period; 203 - extern unsigned long nlmsvc_timeout; 203 + extern unsigned long nlm_timeout; 204 204 extern bool nsm_use_hostnames; 205 205 extern u32 nsm_local_state; 206 206