FreeBSD/sys/nlm/nlm_prot_impl.c
/*
 * Free resources used by a host. This is called after the reference
 * count has reached zero so it doesn't need to worry about locks.
 */
Free resources used by a host. This is called after the reference
count has reached zero so it doesn't need to worry about locks.
Free resources used by a host . This is called after the reference count has reached zero so it doesn ' t need to worry about locks .
static void
nlm_host_destroy(struct nlm_host *host)
{
	mtx_lock(&nlm_global_lock);
	TAILQ_REMOVE(&nlm_hosts, host, nh_link);
	mtx_unlock(&nlm_global_lock);
	if (host->nh_srvrpc.nr_client)
		CLNT_RELEASE(host->nh_srvrpc.nr_client);
	if (host->nh_clntrpc.nr_client)
		CLNT_RELEASE(host->nh_clntrpc.nr_client);
	mtx_destroy(&host->nh_lock);
	sysctl_ctx_free(&host->nh_sysctl);
	free(host, M_NLM);
}
static void nlm_host_destroy ( struct nlm_host * host ) { mtx_lock ( & nlm_global_lock ) ; TAILQ_REMOVE ( & nlm_hosts , host , nh_link ) ; mtx_unlock ( & nlm_global_lock ) ; if ( host -> nh_srvrpc . nr_client ) CLNT_RELEASE ( host -> nh_srvrpc . nr_client ) ; if ( host -> nh_clntrpc . nr_client ) CLNT_RELEASE ( host -> nh_clntrpc . nr_client ) ; mtx_destroy ( & host -> nh_lock ) ; sysctl_ctx_free ( & host -> nh_sysctl ) ; free ( host , M_NLM ) ; }
Free resources used by a host.
Free resources used by a host .