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.c57
1 files changed, 30 insertions, 27 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 6c56090ca531..8cbf53d2c1bb 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -572,6 +572,35 @@ void nlm_host_rebooted(const struct nlm_reboot *info)
572 nsm_release(nsm); 572 nsm_release(nsm);
573} 573}
574 574
575static void nlm_complain_hosts(struct net *net)
576{
577 struct hlist_head *chain;
578 struct hlist_node *pos;
579 struct nlm_host *host;
580
581 if (net) {
582 struct lockd_net *ln = net_generic(net, lockd_net_id);
583
584 if (ln->nrhosts == 0)
585 return;
586 printk(KERN_WARNING "lockd: couldn't shutdown host module for net %p!\n", net);
587 dprintk("lockd: %lu hosts left in net %p:\n", ln->nrhosts, net);
588 } else {
589 if (nrhosts == 0)
590 return;
591 printk(KERN_WARNING "lockd: couldn't shutdown host module!\n");
592 dprintk("lockd: %lu hosts left:\n", nrhosts);
593 }
594
595 for_each_host(host, pos, chain, nlm_server_hosts) {
596 if (net && host->net != net)
597 continue;
598 dprintk(" %s (cnt %d use %d exp %ld net %p)\n",
599 host->h_name, atomic_read(&host->h_count),
600 host->h_inuse, host->h_expires, host->net);
601 }
602}
603
575void 604void
576nlm_shutdown_hosts_net(struct net *net) 605nlm_shutdown_hosts_net(struct net *net)
577{ 606{
@@ -598,18 +627,7 @@ nlm_shutdown_hosts_net(struct net *net)
598 nlm_gc_hosts(net); 627 nlm_gc_hosts(net);
599 mutex_unlock(&nlm_host_mutex); 628 mutex_unlock(&nlm_host_mutex);
600 629
601 /* complain if any hosts are left */ 630 nlm_complain_hosts(net);
602 if (net) {
603 struct lockd_net *ln = net_generic(net, lockd_net_id);
604
605 printk(KERN_WARNING "lockd: couldn't shutdown host module for net %p!\n", net);
606 dprintk("lockd: %lu hosts left in net %p:\n", ln->nrhosts, net);
607 for_each_host(host, pos, chain, nlm_server_hosts) {
608 dprintk(" %s (cnt %d use %d exp %ld net %p)\n",
609 host->h_name, atomic_read(&host->h_count),
610 host->h_inuse, host->h_expires, host->net);
611 }
612 }
613} 631}
614 632
615/* 633/*
@@ -619,22 +637,7 @@ nlm_shutdown_hosts_net(struct net *net)
619void 637void
620nlm_shutdown_hosts(void) 638nlm_shutdown_hosts(void)
621{ 639{
622 struct hlist_head *chain;
623 struct hlist_node *pos;
624 struct nlm_host *host;
625
626 nlm_shutdown_hosts_net(NULL); 640 nlm_shutdown_hosts_net(NULL);
627
628 /* complain if any hosts are left */
629 if (nrhosts != 0) {
630 printk(KERN_WARNING "lockd: couldn't shutdown host module!\n");
631 dprintk("lockd: %lu hosts left:\n", nrhosts);
632 for_each_host(host, pos, chain, nlm_server_hosts) {
633 dprintk(" %s (cnt %d use %d exp %ld net %p)\n",
634 host->h_name, atomic_read(&host->h_count),
635 host->h_inuse, host->h_expires, host->net);
636 }
637 }
638} 641}
639 642
640/* 643/*