Lines Matching refs:hostp

71 get_nlm_rpc_fromcache(struct nlm_host *hostp, int vers)  in get_nlm_rpc_fromcache()  argument
76 ASSERT(MUTEX_HELD(&hostp->nh_lock)); in get_nlm_rpc_fromcache()
77 if (TAILQ_EMPTY(&hostp->nh_rpchc)) in get_nlm_rpc_fromcache()
80 TAILQ_FOREACH(rpcp, &hostp->nh_rpchc, nr_link) { in get_nlm_rpc_fromcache()
90 TAILQ_REMOVE(&hostp->nh_rpchc, rpcp, nr_link); in get_nlm_rpc_fromcache()
99 update_host_rpcbinding(struct nlm_host *hostp, int vers) in update_host_rpcbinding() argument
103 ASSERT(MUTEX_HELD(&hostp->nh_lock)); in update_host_rpcbinding()
110 hostp->nh_rpcb_state = NRPCB_UPDATE_INPROGRESS; in update_host_rpcbinding()
111 hostp->nh_rpcb_ustat = RPC_SUCCESS; in update_host_rpcbinding()
112 mutex_exit(&hostp->nh_lock); in update_host_rpcbinding()
114 stat = rpcbind_getaddr(&hostp->nh_knc, NLM_PROG, vers, &hostp->nh_addr); in update_host_rpcbinding()
115 mutex_enter(&hostp->nh_lock); in update_host_rpcbinding()
117 hostp->nh_rpcb_state = ((stat == RPC_SUCCESS) ? in update_host_rpcbinding()
120 hostp->nh_rpcb_ustat = stat; in update_host_rpcbinding()
121 cv_broadcast(&hostp->nh_rpcb_cv); in update_host_rpcbinding()
131 refresh_nlm_rpc(struct nlm_host *hostp, nlm_rpc_t *rpcp) in refresh_nlm_rpc() argument
139 ret = clnt_tli_kcreate(&hostp->nh_knc, &hostp->nh_addr, in refresh_nlm_rpc()
158 ret = clnt_tli_kinit(rpcp->nr_handle, &hostp->nh_knc, in refresh_nlm_rpc()
159 &hostp->nh_addr, 0, NLM_RPC_RETRIES, CRED()); in refresh_nlm_rpc()
199 nlm_host_get_rpc(struct nlm_host *hostp, int vers, nlm_rpc_t **rpcpp) in nlm_host_get_rpc() argument
204 mutex_enter(&hostp->nh_lock); in nlm_host_get_rpc()
214 while (hostp->nh_rpcb_state != NRPCB_UPDATED) { in nlm_host_get_rpc()
215 if (hostp->nh_rpcb_state == NRPCB_UPDATE_INPROGRESS) { in nlm_host_get_rpc()
216 rc = cv_wait_sig(&hostp->nh_rpcb_cv, &hostp->nh_lock); in nlm_host_get_rpc()
218 mutex_exit(&hostp->nh_lock); in nlm_host_get_rpc()
230 if (hostp->nh_rpcb_state == NRPCB_NEED_UPDATE) in nlm_host_get_rpc()
231 update_host_rpcbinding(hostp, vers); in nlm_host_get_rpc()
238 if (hostp->nh_rpcb_ustat != RPC_SUCCESS) { in nlm_host_get_rpc()
239 mutex_exit(&hostp->nh_lock); in nlm_host_get_rpc()
245 rpcp = get_nlm_rpc_fromcache(hostp, vers); in nlm_host_get_rpc()
246 mutex_exit(&hostp->nh_lock); in nlm_host_get_rpc()
259 rc = refresh_nlm_rpc(hostp, rpcp); in nlm_host_get_rpc()
268 mutex_enter(&hostp->nh_lock); in nlm_host_get_rpc()
269 hostp->nh_rpcb_state = NRPCB_NEED_UPDATE; in nlm_host_get_rpc()
270 nlm_host_rele_rpc_locked(hostp, rpcp); in nlm_host_get_rpc()
278 DTRACE_PROBE2(end, struct nlm_host *, hostp, in nlm_host_get_rpc()
285 NLM_ERR("Can't get RPC client handle for: %s", hostp->nh_name); in nlm_host_get_rpc()
290 nlm_host_rele_rpc(struct nlm_host *hostp, nlm_rpc_t *rpcp) in nlm_host_rele_rpc() argument
292 mutex_enter(&hostp->nh_lock); in nlm_host_rele_rpc()
293 nlm_host_rele_rpc_locked(hostp, rpcp); in nlm_host_rele_rpc()
294 mutex_exit(&hostp->nh_lock); in nlm_host_rele_rpc()
298 nlm_host_rele_rpc_locked(struct nlm_host *hostp, nlm_rpc_t *rpcp) in nlm_host_rele_rpc_locked() argument
300 ASSERT(mutex_owned(&hostp->nh_lock)); in nlm_host_rele_rpc_locked()
301 TAILQ_INSERT_HEAD(&hostp->nh_rpchc, rpcp, nr_link); in nlm_host_rele_rpc_locked()
314 nlm_host_invalidate_binding(struct nlm_host *hostp) in nlm_host_invalidate_binding() argument
316 mutex_enter(&hostp->nh_lock); in nlm_host_invalidate_binding()
317 hostp->nh_rpcb_state = NRPCB_NEED_UPDATE; in nlm_host_invalidate_binding()
318 mutex_exit(&hostp->nh_lock); in nlm_host_invalidate_binding()
330 nlm_rpc_cache_destroy(struct nlm_host *hostp) in nlm_rpc_cache_destroy() argument
341 while ((rpcp = TAILQ_FIRST(&hostp->nh_rpchc)) != NULL) { in nlm_rpc_cache_destroy()
342 TAILQ_REMOVE(&hostp->nh_rpchc, rpcp, nr_link); in nlm_rpc_cache_destroy()