Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320410
b: refs/heads/master
c: d5850ff
h: refs/heads/master
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and J. Bruce Fields committed Jul 27, 2012
1 parent 021d1ee commit d8c64f8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 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: caa4e76b6f284bab535a98fd37b9c46856158bcb
refs/heads/master: d5850ff9eaaa9bed0f0b56702db105e02ce4b709
57 changes: 30 additions & 27 deletions trunk/fs/lockd/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,35 @@ void nlm_host_rebooted(const struct nlm_reboot *info)
nsm_release(nsm);
}

static void nlm_complain_hosts(struct net *net)
{
struct hlist_head *chain;
struct hlist_node *pos;
struct nlm_host *host;

if (net) {
struct lockd_net *ln = net_generic(net, lockd_net_id);

if (ln->nrhosts == 0)
return;
printk(KERN_WARNING "lockd: couldn't shutdown host module for net %p!\n", net);
dprintk("lockd: %lu hosts left in net %p:\n", ln->nrhosts, net);
} else {
if (nrhosts == 0)
return;
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) {
if (net && host->net != net)
continue;
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->net);
}
}

void
nlm_shutdown_hosts_net(struct net *net)
{
Expand All @@ -598,18 +627,7 @@ nlm_shutdown_hosts_net(struct net *net)
nlm_gc_hosts(net);
mutex_unlock(&nlm_host_mutex);

/* complain if any hosts are left */
if (net) {
struct lockd_net *ln = net_generic(net, lockd_net_id);

printk(KERN_WARNING "lockd: couldn't shutdown host module for net %p!\n", net);
dprintk("lockd: %lu hosts left in net %p:\n", ln->nrhosts, net);
for_each_host(host, pos, chain, nlm_server_hosts) {
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->net);
}
}
nlm_complain_hosts(net);
}

/*
Expand All @@ -619,22 +637,7 @@ nlm_shutdown_hosts_net(struct net *net)
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 net %p)\n",
host->h_name, atomic_read(&host->h_count),
host->h_inuse, host->h_expires, host->net);
}
}
}

/*
Expand Down

0 comments on commit d8c64f8

Please sign in to comment.