Lines Matching refs:ncg
172 struct compound_state *cs, struct nfs4_callback_globals *ncg) in cb_getattr() argument
187 ncg->nfs4_callback_stats.cb_getattr.value.ui64++; in cb_getattr()
202 mutex_enter(&ncg->nfs4_cb_lock); in cb_getattr()
203 sp = ncg->nfs4prog2server[req->rq_prog - NFS4_CALLBACK]; in cb_getattr()
204 mutex_exit(&ncg->nfs4_cb_lock); in cb_getattr()
385 struct compound_state *cs, struct nfs4_callback_globals *ncg) in cb_recall() argument
394 ncg->nfs4_callback_stats.cb_recall.value.ui64++; in cb_recall()
410 mutex_enter(&ncg->nfs4_cb_lock); in cb_recall()
411 sp = ncg->nfs4prog2server[req->rq_prog - NFS4_CALLBACK]; in cb_recall()
412 mutex_exit(&ncg->nfs4_cb_lock); in cb_recall()
511 struct nfs4_callback_globals *ncg) in cb_null() argument
515 ncg->nfs4_callback_stats.cb_null.value.ui64++; in cb_null()
520 mutex_enter(&ncg->nfs4_cb_lock); in cb_null()
521 sp = ncg->nfs4prog2server[req->rq_prog - NFS4_CALLBACK]; in cb_null()
522 mutex_exit(&ncg->nfs4_cb_lock); in cb_null()
539 struct compound_state *cs, struct nfs4_callback_globals *ncg) in cb_illegal() argument
543 ncg->nfs4_callback_stats.cb_illegal.value.ui64++; in cb_illegal()
550 struct nfs4_callback_globals *ncg) in cb_compound() argument
614 cb_getattr(argop, resop, req, &cs, ncg); in cb_compound()
619 cb_recall(argop, resop, req, &cs, ncg); in cb_compound()
634 cb_illegal(argop, resop, req, &cs, ncg); in cb_compound()
703 struct nfs4_callback_globals *ncg; in cb_dispatch() local
710 ncg = zone_getspecific(nfs4_callback_zone_key, nfs_zone()); in cb_dispatch()
711 ASSERT(ncg != NULL); in cb_dispatch()
713 ncg->nfs4_callback_stats.cb_dispatch.value.ui64++; in cb_dispatch()
746 (*proc)(&args, &res, req, ncg); in cb_dispatch()
764 nfs4_getnextprogram(struct nfs4_callback_globals *ncg) in nfs4_getnextprogram() argument
768 j = ncg->nfs4_program_hint; in nfs4_getnextprogram()
774 if (ncg->nfs4prog2server[j] == NULL) { in nfs4_getnextprogram()
775 ncg->nfs4_program_hint = j+1; in nfs4_getnextprogram()
786 struct nfs4_callback_globals *ncg; in nfs4callback_destroy() local
792 ncg = np->zone_globals; in nfs4callback_destroy()
795 mutex_enter(&ncg->nfs4_cb_lock); in nfs4callback_destroy()
797 ASSERT(ncg->nfs4prog2server[i] == np); in nfs4callback_destroy()
799 ncg->nfs4prog2server[i] = NULL; in nfs4callback_destroy()
801 if (i < ncg->nfs4_program_hint) in nfs4callback_destroy()
802 ncg->nfs4_program_hint = i; in nfs4callback_destroy()
804 mutex_exit(&ncg->nfs4_cb_lock); in nfs4callback_destroy()
813 struct nfs4_callback_globals *ncg) in nfs4_setport() argument
818 ASSERT(MUTEX_HELD(&ncg->nfs4_cb_lock)); in nfs4_setport()
820 p = list_head(&ncg->nfs4_cb_ports); in nfs4_setport()
821 for (; p != NULL; p = list_next(&ncg->nfs4_cb_ports, p)) { in nfs4_setport()
836 list_insert_head(&ncg->nfs4_cb_ports, p); in nfs4_setport()
851 struct nfs4_callback_globals *ncg = np->zone_globals; in nfs4_cb_args() local
862 mutex_enter(&ncg->nfs4_cb_lock); in nfs4_cb_args()
864 p = list_head(&ncg->nfs4_cb_ports); in nfs4_cb_args()
865 for (; p != NULL; p = list_next(&ncg->nfs4_cb_ports, p)) { in nfs4_cb_args()
883 mutex_exit(&ncg->nfs4_cb_lock); in nfs4_cb_args()
887 if ((pgm = nfs4_getnextprogram(ncg)) == 0) { in nfs4_cb_args()
894 mutex_exit(&ncg->nfs4_cb_lock); in nfs4_cb_args()
898 ncg->nfs4prog2server[pgm-NFS4_CALLBACK] = np; in nfs4_cb_args()
906 mutex_exit(&ncg->nfs4_cb_lock); in nfs4_cb_args()
968 struct nfs4_callback_globals *ncg; in nfs4_svc() local
1044 ncg = zone_getspecific(nfs4_callback_zone_key, nfs_zone()); in nfs4_svc()
1045 ASSERT(ncg != NULL); in nfs4_svc()
1047 mutex_enter(&ncg->nfs4_cb_lock); in nfs4_svc()
1049 nfs4_setport(buf, uaddr, protofmly, proto, ncg); in nfs4_svc()
1061 mutex_exit(&ncg->nfs4_cb_lock); in nfs4_svc()
1076 struct nfs4_callback_globals *ncg; in nfs4_callback_init_zone() local
1078 ncg = kmem_zalloc(sizeof (*ncg), KM_SLEEP); in nfs4_callback_init_zone()
1080 ncg->nfs4prog2server = kmem_zalloc(nfs4_num_prognums * in nfs4_callback_init_zone()
1084 mutex_init(&ncg->nfs4_dlist_lock, NULL, MUTEX_DEFAULT, NULL); in nfs4_callback_init_zone()
1085 list_create(&ncg->nfs4_dlist, sizeof (struct nfs4_dnode), in nfs4_callback_init_zone()
1089 mutex_init(&ncg->nfs4_cb_lock, NULL, MUTEX_DEFAULT, NULL); in nfs4_callback_init_zone()
1090 list_create(&ncg->nfs4_cb_ports, sizeof (struct nfs4_cb_port), in nfs4_callback_init_zone()
1094 bcopy(&nfs4_callback_stats_tmpl, &ncg->nfs4_callback_stats, in nfs4_callback_init_zone()
1100 sizeof (ncg->nfs4_callback_stats) / sizeof (kstat_named_t), in nfs4_callback_init_zone()
1103 nfs4_callback_kstat->ks_data = &ncg->nfs4_callback_stats; in nfs4_callback_init_zone()
1106 return (ncg); in nfs4_callback_init_zone()
1110 nfs4_discard_delegations(struct nfs4_callback_globals *ncg) in nfs4_discard_delegations() argument
1122 mutex_enter(&ncg->nfs4_cb_lock); in nfs4_discard_delegations()
1123 sp = ncg->nfs4prog2server[i]; in nfs4_discard_delegations()
1124 mutex_exit(&ncg->nfs4_cb_lock); in nfs4_discard_delegations()
1150 nfs4delegreturn_cleanup_impl(rp, sp, ncg); in nfs4_discard_delegations()
1167 struct nfs4_callback_globals *ncg = data; in nfs4_callback_shutdown_zone() local
1172 nfs4_dlistclean_impl(ncg, NFS4_DR_DISCARD); in nfs4_callback_shutdown_zone()
1177 nfs4_discard_delegations(ncg); in nfs4_callback_shutdown_zone()
1183 struct nfs4_callback_globals *ncg = data; in nfs4_callback_fini_zone() local
1195 nfs4_discard_delegations(ncg); in nfs4_callback_fini_zone()
1230 ASSERT(ncg->nfs4prog2server[i] == NULL); in nfs4_callback_fini_zone()
1233 kmem_free(ncg->nfs4prog2server, nfs4_num_prognums * in nfs4_callback_fini_zone()
1236 mutex_enter(&ncg->nfs4_cb_lock); in nfs4_callback_fini_zone()
1237 while ((p = list_head(&ncg->nfs4_cb_ports)) != NULL) { in nfs4_callback_fini_zone()
1238 list_remove(&ncg->nfs4_cb_ports, p); in nfs4_callback_fini_zone()
1241 list_destroy(&ncg->nfs4_cb_ports); in nfs4_callback_fini_zone()
1242 mutex_destroy(&ncg->nfs4_cb_lock); in nfs4_callback_fini_zone()
1243 list_destroy(&ncg->nfs4_dlist); in nfs4_callback_fini_zone()
1244 mutex_destroy(&ncg->nfs4_dlist_lock); in nfs4_callback_fini_zone()
1245 kmem_free(ncg, sizeof (*ncg)); in nfs4_callback_fini_zone()
1297 struct nfs4_callback_globals *ncg) in nfs4delegreturn_cleanup_impl() argument
1353 if (ncg != NULL) in nfs4delegreturn_cleanup_impl()
1354 ncg->nfs4_callback_stats.delegations.value.ui64--; in nfs4delegreturn_cleanup_impl()
1360 struct nfs4_callback_globals *ncg; in nfs4delegreturn_cleanup() local
1363 ncg = np->zone_globals; in nfs4delegreturn_cleanup()
1365 ncg = zone_getspecific(nfs4_callback_zone_key, nfs_zone()); in nfs4delegreturn_cleanup()
1366 ASSERT(ncg != NULL); in nfs4delegreturn_cleanup()
1372 ncg = NULL; in nfs4delegreturn_cleanup()
1375 nfs4delegreturn_cleanup_impl(rp, np, ncg); in nfs4delegreturn_cleanup()
1451 struct nfs4_callback_globals *ncg) in nfs4_do_delegreturn() argument
1460 ncg->nfs4_callback_stats.delegreturn.value.ui64++; in nfs4_do_delegreturn()
1470 nfs4delegreturn_cleanup_impl(rp, NULL, ncg); in nfs4_do_delegreturn()
1528 nfs4delegreturn_cleanup_impl(rp, NULL, ncg); in nfs4_do_delegreturn()
1583 nfs4delegreturn_impl(rnode4_t *rp, int flags, struct nfs4_callback_globals *ncg) in nfs4delegreturn_impl() argument
1601 nfs4delegreturn_cleanup_impl(rp, NULL, ncg); in nfs4delegreturn_impl()
1664 error = deleg_reopen(vp, &needrecov, ncg, flags); in nfs4delegreturn_impl()
1692 nfs4delegreturn_cleanup_impl(rp, NULL, ncg); in nfs4delegreturn_impl()
1695 error = nfs4_do_delegreturn(rp, flags, cr, ncg); in nfs4delegreturn_impl()
1709 struct nfs4_callback_globals *ncg; in nfs4delegreturn() local
1711 ncg = zone_getspecific(nfs4_callback_zone_key, nfs_zone()); in nfs4delegreturn()
1712 ASSERT(ncg != NULL); in nfs4delegreturn()
1714 return (nfs4delegreturn_impl(rp, flags, ncg)); in nfs4delegreturn()
1746 struct nfs4_callback_globals *ncg; in delegreturn_all_thread() local
1773 ncg = np->zone_globals; in delegreturn_all_thread()
1779 ncg); in delegreturn_all_thread()
1830 struct nfs4_callback_globals *ncg; in nfs4_deleg_discard() local
1833 ncg = sp->zone_globals; in nfs4_deleg_discard()
1873 ncg->nfs4_callback_stats.delegations.value.ui64--; in nfs4_deleg_discard()
1885 deleg_reopen(vnode_t *vp, bool_t *recovp, struct nfs4_callback_globals *ncg, in deleg_reopen() argument
1923 ncg->nfs4_callback_stats.claim_cur.value.ui64++; in deleg_reopen()
1928 ncg->nfs4_callback_stats. in deleg_reopen()
1958 ncg->nfs4_callback_stats.recall_failed.value.ui64++; in deleg_reopen()
2048 struct nfs4_callback_globals *ncg; in nfs4delegreturn_thread() local
2050 ncg = zone_getspecific(nfs4_callback_zone_key, nfs_zone()); in nfs4delegreturn_thread()
2051 ASSERT(ncg != NULL); in nfs4delegreturn_thread()
2098 ncg->nfs4_callback_stats.recall_trunc.value.ui64++; in nfs4delegreturn_thread()
2138 (void) nfs4delegreturn_impl(rp, flags, ncg); in nfs4delegreturn_thread()
2173 struct nfs4_callback_globals *ncg; in nfs4_delegation_accept() local
2176 ncg = zone_getspecific(nfs4_callback_zone_key, nfs_zone()); in nfs4_delegation_accept()
2177 ASSERT(ncg != NULL); in nfs4_delegation_accept()
2216 ncg->nfs4_callback_stats.delegations.value.ui64++; in nfs4_delegation_accept()
2217 ncg->nfs4_callback_stats.delegaccept_r.value.ui64++; in nfs4_delegation_accept()
2260 ncg->nfs4_callback_stats.delegations.value.ui64++; in nfs4_delegation_accept()
2261 ncg->nfs4_callback_stats.delegaccept_rw.value.ui64++; in nfs4_delegation_accept()
2328 nfs4_dlistadd(rp, ncg, dr_flags); in nfs4_delegation_accept()
2341 (void) nfs4delegreturn_impl(rp, dr_flags, ncg); in nfs4_delegation_accept()
2465 nfs4_dlistadd(rnode4_t *rp, struct nfs4_callback_globals *ncg, int flags) in nfs4_dlistadd() argument
2480 mutex_enter(&ncg->nfs4_dlist_lock); in nfs4_dlistadd()
2481 list_insert_head(&ncg->nfs4_dlist, dp); in nfs4_dlistadd()
2483 ncg->nfs4_dlistadd_c++; in nfs4_dlistadd()
2485 mutex_exit(&ncg->nfs4_dlist_lock); in nfs4_dlistadd()
2495 nfs4_dlistclean_impl(struct nfs4_callback_globals *ncg, int override_flags) in nfs4_dlistclean_impl() argument
2503 mutex_enter(&ncg->nfs4_dlist_lock); in nfs4_dlistclean_impl()
2504 while ((dp = list_head(&ncg->nfs4_dlist)) != NULL) { in nfs4_dlistclean_impl()
2506 ncg->nfs4_dlistclean_c++; in nfs4_dlistclean_impl()
2508 list_remove(&ncg->nfs4_dlist, dp); in nfs4_dlistclean_impl()
2509 mutex_exit(&ncg->nfs4_dlist_lock); in nfs4_dlistclean_impl()
2513 (void) nfs4delegreturn_impl(rp, flags, ncg); in nfs4_dlistclean_impl()
2515 mutex_enter(&ncg->nfs4_dlist_lock); in nfs4_dlistclean_impl()
2517 mutex_exit(&ncg->nfs4_dlist_lock); in nfs4_dlistclean_impl()
2523 struct nfs4_callback_globals *ncg; in nfs4_dlistclean() local
2525 ncg = zone_getspecific(nfs4_callback_zone_key, nfs_zone()); in nfs4_dlistclean()
2526 ASSERT(ncg != NULL); in nfs4_dlistclean()
2528 nfs4_dlistclean_impl(ncg, 0); in nfs4_dlistclean()