Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294474
b: refs/heads/master
c: 3b64739
h: refs/heads/master
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and Trond Myklebust committed Feb 15, 2012
1 parent 8c80d08 commit 386649e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e1cb5c0aad1c37a4eee6db45f52c0b3869db2cc
refs/heads/master: 3b64739fb928c34b13db6b5adcb0d3efb19e78be
26 changes: 19 additions & 7 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,8 @@ void nlm_host_rebooted(const struct nlm_reboot *info)
nsm_release(nsm);
}

/*
* Shut down the hosts module.
* Note that this routine is called only at server shutdown time.
*/
void
nlm_shutdown_hosts(void)
nlm_shutdown_hosts_net(struct net *net)
{
struct hlist_head *chain;
struct hlist_node *pos;
Expand All @@ -582,6 +578,8 @@ nlm_shutdown_hosts(void)
/* First, make all hosts eligible for gc */
dprintk("lockd: nuking all hosts...\n");
for_each_host(host, pos, chain, nlm_server_hosts) {
if (net && host->net != net)
continue;
host->h_expires = jiffies - 1;
if (host->h_rpcclnt) {
rpc_shutdown_client(host->h_rpcclnt);
Expand All @@ -592,15 +590,29 @@ nlm_shutdown_hosts(void)
/* Then, perform a garbage collection pass */
nlm_gc_hosts();
mutex_unlock(&nlm_host_mutex);
}

/*
* Shut down the hosts module.
* Note that this routine is called only at server shutdown time.
*/
void
nlm_shutdown_hosts(void)
{
struct hlist_head *chain;
struct hlist_node *pos;
struct nlm_host *host;

nlm_shutdown_hosts_net(NULL);

/* complain if any hosts are left */
if (nrhosts != 0) {
printk(KERN_WARNING "lockd: couldn't shutdown host module!\n");
dprintk("lockd: %lu hosts left:\n", nrhosts);
for_each_host(host, pos, chain, nlm_server_hosts) {
dprintk(" %s (cnt %d use %d exp %ld)\n",
dprintk(" %s (cnt %d use %d exp %ld net %p)\n",
host->h_name, atomic_read(&host->h_count),
host->h_inuse, host->h_expires);
host->h_inuse, host->h_expires, host->net);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion trunk/fs/lockd/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,10 @@ static void lockd_down_net(struct net *net)
struct svc_serv *serv = nlmsvc_rqst->rq_server;

if (ln->nlmsvc_users) {
if (--ln->nlmsvc_users == 0)
if (--ln->nlmsvc_users == 0) {
nlm_shutdown_hosts_net(net);
svc_shutdown_net(serv, net);
}
} else {
printk(KERN_ERR "lockd_down_net: no users! task=%p, net=%p\n",
nlmsvc_task, net);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/lockd/lockd.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ struct rpc_clnt * nlm_bind_host(struct nlm_host *);
void nlm_rebind_host(struct nlm_host *);
struct nlm_host * nlm_get_host(struct nlm_host *);
void nlm_shutdown_hosts(void);
void nlm_shutdown_hosts_net(struct net *net);
void nlm_host_rebooted(const struct nlm_reboot *);

/*
Expand Down

0 comments on commit 386649e

Please sign in to comment.