aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r--fs/lockd/host.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 572601e98dcd..ca6b16fc3101 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -34,10 +34,10 @@ static DEFINE_MUTEX(nlm_host_mutex);
34 34
35static void nlm_gc_hosts(void); 35static void nlm_gc_hosts(void);
36static struct nsm_handle * __nsm_find(const struct sockaddr_in *, 36static struct nsm_handle * __nsm_find(const struct sockaddr_in *,
37 const char *, int, int); 37 const char *, unsigned int, int);
38static struct nsm_handle * nsm_find(const struct sockaddr_in *sin, 38static struct nsm_handle * nsm_find(const struct sockaddr_in *sin,
39 const char *hostname, 39 const char *hostname,
40 int hostname_len); 40 unsigned int hostname_len);
41 41
42/* 42/*
43 * Common host lookup routine for server & client 43 * Common host lookup routine for server & client
@@ -45,7 +45,8 @@ static struct nsm_handle * nsm_find(const struct sockaddr_in *sin,
45static struct nlm_host * 45static struct nlm_host *
46nlm_lookup_host(int server, const struct sockaddr_in *sin, 46nlm_lookup_host(int server, const struct sockaddr_in *sin,
47 int proto, int version, const char *hostname, 47 int proto, int version, const char *hostname,
48 int hostname_len, const struct sockaddr_in *ssin) 48 unsigned int hostname_len,
49 const struct sockaddr_in *ssin)
49{ 50{
50 struct hlist_head *chain; 51 struct hlist_head *chain;
51 struct hlist_node *pos; 52 struct hlist_node *pos;
@@ -176,7 +177,7 @@ nlm_destroy_host(struct nlm_host *host)
176 */ 177 */
177struct nlm_host * 178struct nlm_host *
178nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version, 179nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version,
179 const char *hostname, int hostname_len) 180 const char *hostname, unsigned int hostname_len)
180{ 181{
181 struct sockaddr_in ssin = {0}; 182 struct sockaddr_in ssin = {0};
182 183
@@ -189,7 +190,7 @@ nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version,
189 */ 190 */
190struct nlm_host * 191struct nlm_host *
191nlmsvc_lookup_host(struct svc_rqst *rqstp, 192nlmsvc_lookup_host(struct svc_rqst *rqstp,
192 const char *hostname, int hostname_len) 193 const char *hostname, unsigned int hostname_len)
193{ 194{
194 struct sockaddr_in ssin = {0}; 195 struct sockaddr_in ssin = {0};
195 196
@@ -307,7 +308,8 @@ void nlm_release_host(struct nlm_host *host)
307 * Release all resources held by that peer. 308 * Release all resources held by that peer.
308 */ 309 */
309void nlm_host_rebooted(const struct sockaddr_in *sin, 310void nlm_host_rebooted(const struct sockaddr_in *sin,
310 const char *hostname, int hostname_len, 311 const char *hostname,
312 unsigned int hostname_len,
311 u32 new_state) 313 u32 new_state)
312{ 314{
313 struct hlist_head *chain; 315 struct hlist_head *chain;
@@ -377,8 +379,13 @@ nlm_shutdown_hosts(void)
377 /* First, make all hosts eligible for gc */ 379 /* First, make all hosts eligible for gc */
378 dprintk("lockd: nuking all hosts...\n"); 380 dprintk("lockd: nuking all hosts...\n");
379 for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) { 381 for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) {
380 hlist_for_each_entry(host, pos, chain, h_hash) 382 hlist_for_each_entry(host, pos, chain, h_hash) {
381 host->h_expires = jiffies - 1; 383 host->h_expires = jiffies - 1;
384 if (host->h_rpcclnt) {
385 rpc_shutdown_client(host->h_rpcclnt);
386 host->h_rpcclnt = NULL;
387 }
388 }
382 } 389 }
383 390
384 /* Then, perform a garbage collection pass */ 391 /* Then, perform a garbage collection pass */
@@ -449,7 +456,7 @@ static DEFINE_MUTEX(nsm_mutex);
449 456
450static struct nsm_handle * 457static struct nsm_handle *
451__nsm_find(const struct sockaddr_in *sin, 458__nsm_find(const struct sockaddr_in *sin,
452 const char *hostname, int hostname_len, 459 const char *hostname, unsigned int hostname_len,
453 int create) 460 int create)
454{ 461{
455 struct nsm_handle *nsm = NULL; 462 struct nsm_handle *nsm = NULL;
@@ -503,7 +510,8 @@ out:
503} 510}
504 511
505static struct nsm_handle * 512static struct nsm_handle *
506nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len) 513nsm_find(const struct sockaddr_in *sin, const char *hostname,
514 unsigned int hostname_len)
507{ 515{
508 return __nsm_find(sin, hostname, hostname_len, 1); 516 return __nsm_find(sin, hostname, hostname_len, 1);
509} 517}