Lines Matching refs:g
74 struct nlm_globals *g;
76 g = kmem_zalloc(sizeof (*g), KM_SLEEP);
78 avl_create(&g->nlm_hosts_tree, nlm_host_cmp,
82 g->nlm_hosts_hash = mod_hash_create_idhash("nlm_host_by_sysid",
85 TAILQ_INIT(&g->nlm_idle_hosts);
86 TAILQ_INIT(&g->nlm_slocks);
88 mutex_init(&g->lock, NULL, MUTEX_DEFAULT, NULL);
89 cv_init(&g->nlm_gc_sched_cv, NULL, CV_DEFAULT, NULL);
90 cv_init(&g->nlm_gc_finish_cv, NULL, CV_DEFAULT, NULL);
91 mutex_init(&g->clean_lock, NULL, MUTEX_DEFAULT, NULL);
93 g->lockd_pid = 0;
94 g->run_status = NLM_ST_DOWN;
96 nlm_globals_register(g);
97 return (g);
104 struct nlm_globals *g = data;
106 ASSERT(avl_is_empty(&g->nlm_hosts_tree));
107 avl_destroy(&g->nlm_hosts_tree);
108 mod_hash_destroy_idhash(g->nlm_hosts_hash);
110 ASSERT(g->nlm_gc_thread == NULL);
111 mutex_destroy(&g->lock);
112 cv_destroy(&g->nlm_gc_sched_cv);
113 cv_destroy(&g->nlm_gc_finish_cv);
114 mutex_destroy(&g->clean_lock);
116 nlm_globals_unregister(g);
117 kmem_free(g, sizeof (*g));
183 struct nlm_globals *g;
188 g = zone_getspecific(nlm_zone_key, curzone);
251 mutex_enter(&g->lock);
256 if (g->run_status == NLM_ST_STOPPING) {
266 if (g->run_status == NLM_ST_DOWN) {
267 g->run_status = NLM_ST_STARTING;
268 g->lockd_pid = curproc->p_pid;
271 g->cn_idle_tmo = args->timout;
272 g->grace_period = args->grace;
273 g->retrans_tmo = args->retransmittimeout;
281 mutex_exit(&g->lock);
282 err = nlm_svc_starting(g, fp, netid, &knc);
283 mutex_enter(&g->lock);
289 if (g->run_status != NLM_ST_UP) {
293 if (g->lockd_pid != curproc->p_pid) {
303 mutex_exit(&g->lock);
318 struct nlm_globals *g;
323 g = zone_getspecific(nlm_zone_key, curzone);
325 mutex_enter(&g->lock);
326 if (g->run_status != NLM_ST_UP) {
327 mutex_exit(&g->lock);
331 g->run_status = NLM_ST_STOPPING;
332 pid = g->lockd_pid;
333 mutex_exit(&g->lock);
334 nlm_svc_stopping(g);
429 struct nlm_globals *g;
438 g = zone_getspecific(nlm_zone_key, curzone);
440 hostp = nlm_host_findcreate(g, name, netid, addr);
453 struct nlm_globals *g;
455 g = zone_getspecific(nlm_zone_key, curzone);
456 nlm_host_release(g, (struct nlm_host *)sysid);