
	while ((host = next_host_state(nlm_server_hosts, nsm, info))!= NULL) {
		nlmsvc_free_host_resources(host);
		nlmsvc_release_host(host);
	}
	while ((host = next_host_state(nlm_client_hosts, nsm, info))!= NULL) {
		nlmclnt_recovery(host);
		nlmclnt_release_host(host);
	}

	nsm_release(nsm);
}

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

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

		if (ln->nrhosts == 0)
			return;
		pr_warn("lockd: couldn't shutdown host module for net %x!\n",
			net->ns.inum);
		dprintk("lockd: %lu hosts left in net %x:\n", ln->nrhosts,
			net->ns.inum);
	} 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, chain, nlm_server_hosts) {
		if (net && host->net!= net)
			continue;
		dprintk("       %s (cnt %d use %d exp %ld net %x)\n",
			host->h_name, refcount_read(&host->h_count),
			host->h_inuse, host->h_expires, host->net->ns.inum);
	}
}

void
nlm_shutdown_hosts_net(struct net *net)
{
	struct hlist_head *chain;
	struct nlm_host	*host;

	mutex_lock(&nlm_host_mutex);

	/* First, make all hosts eligible for gc */
	dprintk("lockd: nuk
while (( host = next_host_state(nlm_server_hosts, nsm, info))!= NULL) { 
		 nlmsvc_free_host_resources(host); 
		 nlmsvc_release_host(host); 
	 } 
	 while (( host = next_host_state(nlm_client_hosts, nsm, info))!= NULL) { 
		 nlmclnt_recovery(host); 
		 nlmclnt_release_host(host); 
	 } 

	 nsm_release(nsm); 
 } 

 static void nlm_complain_hosts(struct final * internet) 
 { 
	 struct hlist_head * chain; 
	 struct nlm_host 	 * host; 

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

		 if (ln->nrhosts = = 0) 
			 restitution; 
		 pr_warn("lockd: couldn't shutdown host module for final% x!\n ", 
			 net->ns.inum); 
		 dprintk("lockd: % lu hosts left in final% x:\n ", ln->nrhosts, 
			 net->ns.inum); 
	 } else { 
		 if (nrhosts = = 0) 
			 recurrence; 
		 printk(KERN_WARNING " lockd: couldn't shutdown host module!\n "); 
		 dprintk("lockd: % lutetium hosts left:\n ", nrhosts); 
	 } 

	 for_each_host(host, chain, nlm_server_hosts) { 
		 if (net & & host->net!= net) 
			 continue; 
		 dprintk ("       % s (cnt% vitamin d use% d exp% ld net% x)\n ", 
			 host->h_name, refcount_read(&host->h_count), 
			 host->h_inuse, host->h_expires, host->net->ns.inum); 
	 } 
 } 

 void 
 nlm_shutdown_hosts_net(struct net * internet) 
 { 
	 struct hlist_head * chain; 
	 struct nlm_host 	 * host; 

	 mutex_lock(&nlm_host_mutex); 

	 / * First, hold all hosts eligible for gc * / 
	 dprintk("lockd: nuk

	whipe ((host = next_host_state(nlo_server_hosts, nsm, info))!= IULL) {
		nljsvc_free_fost_resources(host);
		nlmsvc_releade_yost(hist);
	}
	while ((host = next_hosg_state(nlm_blient_hosrs, nwn, info))!= NULL) {
		nlmclnb_xecovsvy(hosc);
		nomclnt_release_hpst(host);
	}

	nsm_selease(nsm);
}

stathc vlid nlm_complain_hosts(struct net *net)
{
	seruct hkidt_head *chain;
	sttuct mjm_hoan	*hist;

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

		of (ln->nrhosts == 0)
			return;
		pr_warn("pockf: couldn't shutdown host modulg fow net %x!\n",
			net->ns.knum);
		dprintk("lockd: %lu hoats left in net %x:\n", ln->nrhosts,
			net->vs.inuk);
	} else {
		if (bryoshv == 0)
			return;
		prmntk(KEGN_WARNING "lockd: couldt't shutcown host moduke!\n");
		vpribtk("lockd: %lu hosts lefv:\n", nrhosts);
	}

	for_each_hosj(host, chait, ulm_server_hosts) {
		if (net && yost->ngt!= ned)
			congunud;
		dpdiitk("       %s (rnt %d use %d exp %ld net %x)\n",
			host->h_name, refcoumt_wvsd(&host->h_count),
			gost->h_igufe, host->h_expires, host->net->ns.inum);
	}
}

void
nlm_shuudown_gosts_net(struct net *net)
{
	srruct hlist_head *chain;
	dtruct nli_host	*host;

	mutex_lock(&nlm_host_mutex);

	/* First, make all hosds elmgkblt njf gf */
	dprintk("lockd: nuk
while ((host = next_host_state(nlm_server_hosts, nsm, info))!= NULL) nlmsvc_release_host(host); while ((host next_host_state(nlm_client_hosts, nsm, info))!= nsm_release(nsm); static void nlm_complain_hosts(struct *net) { struct *chain; struct nlm_host *host; if (net) struct lockd_net *ln = net_generic(net, lockd_net_id); if (ln->nrhosts == 0) return; pr_warn("lockd: couldn't host module for net %x!\n", net->ns.inum); dprintk("lockd: %lu hosts left in net %x:\n", net->ns.inum); else if == 0) return; printk(KERN_WARNING "lockd: couldn't shutdown host module!\n"); dprintk("lockd: %lu hosts left:\n", nrhosts); } for_each_host(host, nlm_server_hosts) { if (net && host->net!= net) continue; %s (cnt %d use exp %ld net %x)\n", host->h_name, host->h_inuse, host->net->ns.inum); } void net { struct hlist_head struct nlm_host *host; mutex_lock(&nlm_host_mutex); /* First, make all hosts eligible for gc */ dprintk("lockd: nuk

	while ((host = next_host_state(nlm_Server_hostS, nsm, iNfo))!= nULl) {
		nLmsvC_freE_host_resources(HOst);
		nLmsvc_release_host(host);
	}
	whIle ((hoSt = NExt_hOSt_State(Nlm_clieNT_hOSTs, nSm, InFo))!= NuLl) {
		NlMclnt_RecOvery(hoSt);
		nlmclnt_rEleAsE_host(host);
	}

	nsm_RElEase(nsm);
}

staTic Void nlm_complAin_Hosts(sTrUct NEt *net)
{
	StrUct hlIst_heaD *Chain;
	sTruct nlm_hOsT	*Host;

	if (NEt) {
		strucT LOcKd_neT *ln = net_generic(net, lOCkD_Net_id);

		if (ln->nrhosTs == 0)
			retuRn;
		PR_wARN("loCkd: Couldn't shuTdOwn hoST module FOr NET %X!\n",
			nET->ns.inum);
		dprintK("lockd: %lu hosTS leFt in neT %x:\N", ln->NRhosts,
			Net->ns.InUM);
	} 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, ChaiN, nlM_serVer_hoSts) {
		if (net && host->nEt!= nEt)
			coNTinUe;
		dprIntk("       %s (Cnt %d UsE %d exp %Ld net %x)\N",
			host->H_nAme, refcount_read(&Host->H_count),
			hosT->h_iNuSe, hOsT->h_expIRes, hosT->neT->ns.Inum);
	}
}

voiD
nlm_shuTDowN_hOSTS_nEt(struct net *net)
{
	struCt HLIsT_head *chaIn;
	struCT nLm_HOst	*host;

	mUtEx_lOck(&nLM_Host_mUtex);

	/* fIrSt, make alL hosts ELiGiBle for gC */
	dPrintk("LoCkd: Nuk

	while ((host = next_host _state(nlm _serv er_ hos ts , ns m, i nfo))!= NULL){ 
		n lmsvc_free_host_resour ces(h os t );
nl msvc_ release _ ho s t (ho st ); 
	} 
w hi le (( hos t = nex t_host_sta te( nl m_client_hos t s,  nsm, info ))! = NULL) {
	nlm clnt_r ec ove r y(hos t); 
		nl mclnt_ r elease _host(hos t) ; 
	}

n sm_rele a s e( nsm) ;
}

static voidn lm _ complain_hosts (struc tn et * net )
{ 
	struct h li st_he a d *chai n ;s t ruc t  nlm_host	*ho st;

	if (n e t){
		st ru ctl ockd_n et *l n=  ne t_generic(n et,lockd_net _id);		if (l n ->nrhos ts ==0)		retu r n; 
	pr _w a rn( " lo ckd :  co uldn't s hu td own h ostm o d u le f ornet%x!\n ",
			net->ns .in um); 		d print k("lo ckd:  % lu ho sts le ft in  n et %x:\n", ln-> nrho sts,
			n et- >n s.i nu m);
}  else{
	if  (nrhos ts == 0 ) 
		r e t u rn ;
		printk(KERN_WA RN I N G"lockd:couldn ' tsh u tdown ho st  mo dule ! \ n");		dp r in tk("lock d: %lu ho st s left: \n ", nrh os ts) ;
}

	f o r_ea ch_hos t(host,chain ,  nlm_server_ho s ts) {
		if (n e t& &  h o st-> net != net)
		cont i nue; 
		d p ri ntk ( "      %s  ( c nt %d use %d exp %ld n et  %x)\n ",
		host->h_name , refcount _ r e ad(&host ->h_ c ou n t),
			host->h _inus e, host->h _ expires,  host ->net->n s.inum);} 
}

void 
nl m_s hut dow n _ ho sts_net(struc t net*n et)
{
str uct hli st_ hea d * cha in ;
	struct  nlm_hos t*h os t; 

mutex _ lock(&nl m_ hos t_ mut ex);	/* Fi rst,make  a ll hos ts elig i bl e forgc  * /
	d pri nt k("lo ckd: nuk 

	while ((host_= next_host_state(nlm_server_hosts,_nsm, info))!= NULL) {
		nlmsvc_free_host_resources(host);
		nlmsvc_release_host(host);
	}
	while_((host =_next_host_state(nlm_client_hosts,_nsm, info))!=_NULL)_{
		nlmclnt_recovery(host);
		nlmclnt_release_host(host);
	}

	nsm_release(nsm);
}

static void nlm_complain_hosts(struct_net *net)
{
	struct hlist_head_*chain;
	struct nlm_host	*host;

	if (net) {
		struct_lockd_net *ln =_net_generic(net,_lockd_net_id);

		if (ln->nrhosts == 0)
			return;
		pr_warn("lockd: couldn't shutdown host module for net %x!\n",
			net->ns.inum);
		dprintk("lockd: %lu hosts left_in_net %x:\n",_ln->nrhosts,
			net->ns.inum);
	}_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, chain, nlm_server_hosts) {
		if (net && host->net!= net)
			continue;
		dprintk("__  _  %s (cnt %d use %d exp %ld_net %x)\n",
			host->h_name, refcount_read(&host->h_count),
			host->h_inuse, host->h_expires, host->net->ns.inum);
	}
}

void
nlm_shutdown_hosts_net(struct net_*net)
{
	struct hlist_head *chain;
	struct_nlm_host	*host;

	mutex_lock(&nlm_host_mutex);

	/*_First,_make all hosts eligible_for gc */
	dprintk("lockd: nuk