Lines Matching refs:g

299 nlm_globals_register(struct nlm_globals *g)  in nlm_globals_register()  argument
302 TAILQ_INSERT_TAIL(&nlm_zones_list, g, nlm_link); in nlm_globals_register()
307 nlm_globals_unregister(struct nlm_globals *g) in nlm_globals_unregister() argument
310 TAILQ_REMOVE(&nlm_zones_list, g, nlm_link); in nlm_globals_unregister()
318 struct nlm_globals *g; in nlm_kmem_reclaim() local
321 TAILQ_FOREACH(g, &nlm_zones_list, nlm_link) in nlm_kmem_reclaim()
322 cv_broadcast(&g->nlm_gc_sched_cv); in nlm_kmem_reclaim()
345 nlm_gc(struct nlm_globals *g) in nlm_gc() argument
350 idle_period = SEC_TO_TICK(g->cn_idle_tmo); in nlm_gc()
351 mutex_enter(&g->lock); in nlm_gc()
357 (void) cv_timedwait(&g->nlm_gc_sched_cv, &g->lock, in nlm_gc()
363 if (g->run_status == NLM_ST_STOPPING) in nlm_gc()
367 DTRACE_PROBE2(gc__start, struct nlm_globals *, g, in nlm_gc()
373 for (hostp = avl_first(&g->nlm_hosts_tree); hostp != NULL; in nlm_gc()
374 hostp = AVL_NEXT(&g->nlm_hosts_tree, hostp)) { in nlm_gc()
411 while ((hostp = TAILQ_FIRST(&g->nlm_idle_hosts)) != NULL) { in nlm_gc()
423 mutex_exit(&g->lock); in nlm_gc()
435 mutex_enter(&g->lock); in nlm_gc()
456 TAILQ_REMOVE(&g->nlm_idle_hosts, in nlm_gc()
459 TAILQ_INSERT_TAIL(&g->nlm_idle_hosts, in nlm_gc()
473 nlm_host_unregister(g, hostp); in nlm_gc()
474 mutex_exit(&g->lock); in nlm_gc()
476 nlm_host_unmonitor(g, hostp); in nlm_gc()
478 mutex_enter(&g->lock); in nlm_gc()
479 if (g->run_status == NLM_ST_STOPPING) in nlm_gc()
487 DTRACE_PROBE1(gc__exit, struct nlm_globals *, g); in nlm_gc()
490 g->nlm_gc_thread = NULL; in nlm_gc()
491 mutex_exit(&g->lock); in nlm_gc()
493 cv_broadcast(&g->nlm_gc_finish_cv); in nlm_gc()
504 struct nlm_globals *g; in nlm_reclaimer() local
510 g = zone_getspecific(nlm_zone_key, curzone); in nlm_reclaimer()
511 nlm_reclaim_client(g, hostp); in nlm_reclaimer()
524 nlm_host_release(g, hostp); in nlm_reclaimer()
601 nlm_suspend_zone(struct nlm_globals *g) in nlm_suspend_zone() argument
618 mutex_enter(&g->lock); in nlm_suspend_zone()
619 for (hostp = avl_first(&g->nlm_hosts_tree); hostp != NULL; in nlm_suspend_zone()
620 hostp = AVL_NEXT(&g->nlm_hosts_tree, hostp)) { in nlm_suspend_zone()
627 TAILQ_REMOVE(&g->nlm_idle_hosts, hostp, nh_link); in nlm_suspend_zone()
641 mutex_exit(&g->lock); in nlm_suspend_zone()
663 nlm_resume_zone(struct nlm_globals *g) in nlm_resume_zone() argument
667 mutex_enter(&g->lock); in nlm_resume_zone()
668 hostp = avl_first(&g->nlm_hosts_tree); in nlm_resume_zone()
683 h_next = AVL_NEXT(&g->nlm_hosts_tree, hostp); in nlm_resume_zone()
684 mutex_exit(&g->lock); in nlm_resume_zone()
734 nlm_client_cancel_all(g, hostp); in nlm_resume_zone()
738 nlm_host_release(g, hostp); in nlm_resume_zone()
740 mutex_enter(&g->lock); in nlm_resume_zone()
743 mutex_exit(&g->lock); in nlm_resume_zone()
1202 nlm_host_unregister(struct nlm_globals *g, struct nlm_host *hostp) in nlm_host_unregister() argument
1207 avl_remove(&g->nlm_hosts_tree, hostp); in nlm_host_unregister()
1208 VERIFY(mod_hash_remove(g->nlm_hosts_hash, in nlm_host_unregister()
1211 TAILQ_REMOVE(&g->nlm_idle_hosts, hostp, nh_link); in nlm_host_unregister()
1352 struct nlm_globals *g; in nlm_host_wait_grace() local
1355 g = zone_getspecific(nlm_zone_key, curzone); in nlm_host_wait_grace()
1363 SEC_TO_TICK(g->retrans_tmo)); in nlm_host_wait_grace()
1419 nlm_host_cancel_slocks(struct nlm_globals *g, struct nlm_host *hostp) in nlm_host_cancel_slocks() argument
1423 mutex_enter(&g->lock); in nlm_host_cancel_slocks()
1424 TAILQ_FOREACH(nslp, &g->nlm_slocks, nsl_link) { in nlm_host_cancel_slocks()
1431 mutex_exit(&g->lock); in nlm_host_cancel_slocks()
1618 nlm_host_find_locked(struct nlm_globals *g, const char *netid, in nlm_host_find_locked() argument
1624 ASSERT(MUTEX_HELD(&g->lock)); in nlm_host_find_locked()
1631 hostp = avl_find(&g->nlm_hosts_tree, &key, &pos); in nlm_host_find_locked()
1639 TAILQ_REMOVE(&g->nlm_idle_hosts, hostp, nh_link); in nlm_host_find_locked()
1655 nlm_host_find(struct nlm_globals *g, const char *netid, in nlm_host_find() argument
1660 mutex_enter(&g->lock); in nlm_host_find()
1661 if (g->run_status != NLM_ST_UP) in nlm_host_find()
1664 hostp = nlm_host_find_locked(g, netid, addr, NULL); in nlm_host_find()
1667 mutex_exit(&g->lock); in nlm_host_find()
1681 nlm_host_findcreate(struct nlm_globals *g, char *name, in nlm_host_findcreate() argument
1689 mutex_enter(&g->lock); in nlm_host_findcreate()
1690 if (g->run_status != NLM_ST_UP) { in nlm_host_findcreate()
1691 mutex_exit(&g->lock); in nlm_host_findcreate()
1695 host = nlm_host_find_locked(g, netid, addr, NULL); in nlm_host_findcreate()
1696 mutex_exit(&g->lock); in nlm_host_findcreate()
1712 mutex_enter(&g->lock); in nlm_host_findcreate()
1713 host = nlm_host_find_locked(g, netid, addr, &where); in nlm_host_findcreate()
1722 avl_insert(&g->nlm_hosts_tree, host, where); in nlm_host_findcreate()
1728 VERIFY(mod_hash_insert(g->nlm_hosts_hash, in nlm_host_findcreate()
1733 mutex_exit(&g->lock); in nlm_host_findcreate()
1755 nlm_host_find_by_sysid(struct nlm_globals *g, sysid_t sysid) in nlm_host_find_by_sysid() argument
1759 mutex_enter(&g->lock); in nlm_host_find_by_sysid()
1760 if (g->run_status != NLM_ST_UP) in nlm_host_find_by_sysid()
1763 (void) mod_hash_find(g->nlm_hosts_hash, in nlm_host_find_by_sysid()
1775 TAILQ_REMOVE(&g->nlm_idle_hosts, hostp, nh_link); in nlm_host_find_by_sysid()
1782 mutex_exit(&g->lock); in nlm_host_find_by_sysid()
1800 nlm_host_release_locked(struct nlm_globals *g, struct nlm_host *hostp) in nlm_host_release_locked() argument
1805 ASSERT(MUTEX_HELD(&g->lock)); in nlm_host_release_locked()
1818 SEC_TO_TICK(g->cn_idle_tmo); in nlm_host_release_locked()
1821 TAILQ_INSERT_TAIL(&g->nlm_idle_hosts, hostp, nh_link); in nlm_host_release_locked()
1826 nlm_host_release(struct nlm_globals *g, struct nlm_host *hostp) in nlm_host_release() argument
1831 mutex_enter(&g->lock); in nlm_host_release()
1832 nlm_host_release_locked(g, hostp); in nlm_host_release()
1833 mutex_exit(&g->lock); in nlm_host_release()
1841 nlm_host_unmonitor(struct nlm_globals *g, struct nlm_host *host) in nlm_host_unmonitor() argument
1850 stat = nlm_nsm_unmon(&g->nlm_nsm, host->nh_name); in nlm_host_unmonitor()
1864 nlm_host_monitor(struct nlm_globals *g, struct nlm_host *host, int state) in nlm_host_monitor() argument
1893 stat = nlm_nsmaddr_reg(&g->nlm_nsm, host->nh_name, family, &obj); in nlm_host_monitor()
1896 mutex_enter(&g->lock); in nlm_host_monitor()
1898 mutex_exit(&g->lock); in nlm_host_monitor()
1911 stat = nlm_nsm_mon(&g->nlm_nsm, host->nh_name, host->nh_sysid); in nlm_host_monitor()
1914 mutex_enter(&g->lock); in nlm_host_monitor()
1916 mutex_exit(&g->lock); in nlm_host_monitor()
1945 struct nlm_globals *g, in nlm_slock_register() argument
1960 mutex_enter(&g->lock); in nlm_slock_register()
1961 TAILQ_INSERT_TAIL(&g->nlm_slocks, nslp, nsl_link); in nlm_slock_register()
1962 mutex_exit(&g->lock); in nlm_slock_register()
1971 nlm_slock_unregister(struct nlm_globals *g, struct nlm_slock *nslp) in nlm_slock_unregister() argument
1973 mutex_enter(&g->lock); in nlm_slock_unregister()
1974 TAILQ_REMOVE(&g->nlm_slocks, nslp, nsl_link); in nlm_slock_unregister()
1975 mutex_exit(&g->lock); in nlm_slock_unregister()
1996 nlm_slock_wait(struct nlm_globals *g, in nlm_slock_wait() argument
2009 mutex_enter(&g->lock); in nlm_slock_wait()
2012 &g->lock, timeo_ticks); in nlm_slock_wait()
2042 mutex_exit(&g->lock); in nlm_slock_wait()
2055 nlm_slock_grant(struct nlm_globals *g, in nlm_slock_grant() argument
2061 mutex_enter(&g->lock); in nlm_slock_grant()
2062 TAILQ_FOREACH(nslp, &g->nlm_slocks, nsl_link) { in nlm_slock_grant()
2080 mutex_exit(&g->lock); in nlm_slock_grant()
2355 nlm_svc_starting(struct nlm_globals *g, struct file *fp, in nlm_svc_starting() argument
2361 VERIFY(g->run_status == NLM_ST_STARTING); in nlm_svc_starting()
2362 VERIFY(g->nlm_gc_thread == NULL); in nlm_svc_starting()
2364 error = nlm_nsm_init_local(&g->nlm_nsm); in nlm_svc_starting()
2368 g->run_status = NLM_ST_DOWN; in nlm_svc_starting()
2378 g->nlm_gc_thread = zthread_create(NULL, 0, nlm_gc, in nlm_svc_starting()
2379 g, 0, minclsyspri); in nlm_svc_starting()
2387 stat = nlm_nsm_simu_crash(&g->nlm_nsm); in nlm_svc_starting()
2394 stat = nlm_nsm_stat(&g->nlm_nsm, &g->nsm_state); in nlm_svc_starting()
2401 g->grace_threshold = ddi_get_lbolt() + in nlm_svc_starting()
2402 SEC_TO_TICK(g->grace_period); in nlm_svc_starting()
2411 g->run_status = NLM_ST_UP; in nlm_svc_starting()
2415 mutex_enter(&g->lock); in nlm_svc_starting()
2416 g->run_status = NLM_ST_STOPPING; in nlm_svc_starting()
2417 mutex_exit(&g->lock); in nlm_svc_starting()
2419 nlm_svc_stopping(g); in nlm_svc_starting()
2446 nlm_svc_stopping(struct nlm_globals *g) in nlm_svc_stopping() argument
2448 mutex_enter(&g->lock); in nlm_svc_stopping()
2449 ASSERT(g->run_status == NLM_ST_STOPPING); in nlm_svc_stopping()
2454 cv_signal(&g->nlm_gc_sched_cv); in nlm_svc_stopping()
2455 while (g->nlm_gc_thread != NULL) in nlm_svc_stopping()
2456 cv_wait(&g->nlm_gc_finish_cv, &g->lock); in nlm_svc_stopping()
2458 mutex_exit(&g->lock); in nlm_svc_stopping()
2465 while (!avl_is_empty(&g->nlm_hosts_tree)) { in nlm_svc_stopping()
2473 hostp = avl_first(&g->nlm_hosts_tree); in nlm_svc_stopping()
2476 nlm_client_cancel_all(g, hostp); in nlm_svc_stopping()
2489 hostp = AVL_NEXT(&g->nlm_hosts_tree, hostp); in nlm_svc_stopping()
2495 hostp = AVL_NEXT(&g->nlm_hosts_tree, hostp); in nlm_svc_stopping()
2505 while ((hostp = TAILQ_FIRST(&g->nlm_idle_hosts)) != NULL) { in nlm_svc_stopping()
2506 nlm_host_unregister(g, hostp); in nlm_svc_stopping()
2521 ASSERT(TAILQ_EMPTY(&g->nlm_slocks)); in nlm_svc_stopping()
2523 nlm_nsm_fini(&g->nlm_nsm); in nlm_svc_stopping()
2524 g->lockd_pid = 0; in nlm_svc_stopping()
2525 g->run_status = NLM_ST_DOWN; in nlm_svc_stopping()
2535 struct nlm_globals *g; in nlm_vp_active() local
2540 g = zone_getspecific(nlm_zone_key, curzone); in nlm_vp_active()
2547 mutex_enter(&g->lock); in nlm_vp_active()
2548 hostp = avl_first(&g->nlm_hosts_tree); in nlm_vp_active()
2558 hostp = AVL_NEXT(&g->nlm_hosts_tree, hostp); in nlm_vp_active()
2561 mutex_exit(&g->lock); in nlm_vp_active()
2573 nlm_zone_unexport(struct nlm_globals *g, struct exportinfo *exi) in nlm_zone_unexport() argument
2577 mutex_enter(&g->lock); in nlm_zone_unexport()
2578 if (g->run_status != NLM_ST_UP) { in nlm_zone_unexport()
2580 mutex_exit(&g->lock); in nlm_zone_unexport()
2584 hostp = avl_first(&g->nlm_hosts_tree); in nlm_zone_unexport()
2589 TAILQ_REMOVE(&g->nlm_idle_hosts, hostp, nh_link); in nlm_zone_unexport()
2594 mutex_exit(&g->lock); in nlm_zone_unexport()
2622 mutex_enter(&g->lock); in nlm_zone_unexport()
2623 nlm_host_release_locked(g, hostp); in nlm_zone_unexport()
2625 hostp = AVL_NEXT(&g->nlm_hosts_tree, hostp); in nlm_zone_unexport()
2628 mutex_exit(&g->lock); in nlm_zone_unexport()
2634 struct nlm_globals *g; in nlm_unexport() local
2637 TAILQ_FOREACH(g, &nlm_zones_list, nlm_link) { in nlm_unexport()
2638 if (g->nlm_zoneid == exi->exi_zoneid) { in nlm_unexport()
2646 nlm_zone_unexport(g, exi); in nlm_unexport()
2796 struct nlm_globals *g; in nlm_cprsuspend() local
2799 TAILQ_FOREACH(g, &nlm_zones_list, nlm_link) in nlm_cprsuspend()
2800 nlm_suspend_zone(g); in nlm_cprsuspend()
2808 struct nlm_globals *g; in nlm_cprresume() local
2811 TAILQ_FOREACH(g, &nlm_zones_list, nlm_link) in nlm_cprresume()
2812 nlm_resume_zone(g); in nlm_cprresume()