aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/host.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 1911f34be976..e58e1426d161 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -231,16 +231,21 @@ out:
231} 231}
232 232
233/* 233/*
234 * Destroy a host 234 * Destroy an nlm_host and free associated resources
235 *
236 * Caller must hold nlm_host_mutex.
235 */ 237 */
236static void 238static void nlm_destroy_host_locked(struct nlm_host *host)
237nlm_destroy_host(struct nlm_host *host)
238{ 239{
239 struct rpc_clnt *clnt; 240 struct rpc_clnt *clnt;
240 241
242 dprintk("lockd: destroy host %s\n", host->h_name);
243
241 BUG_ON(!list_empty(&host->h_lockowners)); 244 BUG_ON(!list_empty(&host->h_lockowners));
242 BUG_ON(atomic_read(&host->h_count)); 245 BUG_ON(atomic_read(&host->h_count));
243 246
247 hlist_del_init(&host->h_hash);
248
244 nsm_unmonitor(host); 249 nsm_unmonitor(host);
245 nsm_release(host->h_nsmhandle); 250 nsm_release(host->h_nsmhandle);
246 251
@@ -248,6 +253,8 @@ nlm_destroy_host(struct nlm_host *host)
248 if (clnt != NULL) 253 if (clnt != NULL)
249 rpc_shutdown_client(clnt); 254 rpc_shutdown_client(clnt);
250 kfree(host); 255 kfree(host);
256
257 nrhosts--;
251} 258}
252 259
253/** 260/**
@@ -589,11 +596,7 @@ nlm_gc_hosts(void)
589 host->h_inuse, host->h_expires); 596 host->h_inuse, host->h_expires);
590 continue; 597 continue;
591 } 598 }
592 dprintk("lockd: delete host %s\n", host->h_name); 599 nlm_destroy_host_locked(host);
593 hlist_del_init(&host->h_hash);
594
595 nlm_destroy_host(host);
596 nrhosts--;
597 } 600 }
598 601
599 next_gc = jiffies + NLM_HOST_COLLECT; 602 next_gc = jiffies + NLM_HOST_COLLECT;