Lines Matching refs:chp

306 	evch_chan_t *chp;  in evch_zonefree()  local
315 while ((chp = evch_dl_next(&eg->evch_list, NULL)) != NULL) { in evch_zonefree()
321 mutex_enter(&chp->ch_mutex); in evch_zonefree()
322 ASSERT(chp->ch_bindings == 0); in evch_zonefree()
323 ASSERT(evch_dl_getnum(&chp->ch_subscr) != 0 || in evch_zonefree()
324 chp->ch_holdpend == CH_HOLD_PEND_INDEF); in evch_zonefree()
327 while ((sdp = evch_dl_next(&chp->ch_subscr, NULL)) != NULL) { in evch_zonefree()
338 evch_evq_unsub(chp->ch_queue, sdp->sd_msub); in evch_zonefree()
346 evch_dl_del(&chp->ch_subscr, &sdp->sd_link); in evch_zonefree()
353 ASSERT(evch_dl_getnum(&chp->ch_subscr) == 0); in evch_zonefree()
356 mutex_exit(&chp->ch_mutex); in evch_zonefree()
357 evch_dl_del(&eg->evch_list, &chp->ch_link); in evch_zonefree()
358 evch_evq_destroy(chp->ch_queue); in evch_zonefree()
359 mutex_destroy(&chp->ch_mutex); in evch_zonefree()
360 mutex_destroy(&chp->ch_pubmx); in evch_zonefree()
361 cv_destroy(&chp->ch_pubcv); in evch_zonefree()
362 kmem_free(chp->ch_name, chp->ch_namelen); in evch_zonefree()
363 kmem_free(chp, sizeof (evch_chan_t)); in evch_zonefree()
966 evch_chan_t *chp = (evch_chan_t *)ch; in evch_destr_event() local
968 mutex_enter(&chp->ch_pubmx); in evch_destr_event()
969 chp->ch_nevents--; in evch_destr_event()
970 cv_signal(&chp->ch_pubcv); in evch_destr_event()
971 mutex_exit(&chp->ch_pubmx); in evch_destr_event()
1027 evch_chan_t *chp; in evch_chinitthr() local
1037 for (chp = evch_dl_next(&eg->evch_list, NULL); chp != NULL; in evch_chinitthr()
1038 chp = evch_dl_next(&eg->evch_list, chp)) { in evch_chinitthr()
1039 for (sdp = evch_dl_next(&chp->ch_subscr, NULL); sdp; in evch_chinitthr()
1040 sdp = evch_dl_next(&chp->ch_subscr, sdp)) { in evch_chinitthr()
1043 evch_evq_thrcreate(chp->ch_queue); in evch_chinitthr()
1146 evch_chan_t *chp = bp->bd_channel; in evch_chunbind() local
1152 mutex_enter(&chp->ch_mutex); in evch_chunbind()
1153 ASSERT(chp->ch_bindings > 0); in evch_chunbind()
1154 chp->ch_bindings--; in evch_chunbind()
1156 if (chp->ch_bindings == 0 && evch_dl_getnum(&chp->ch_subscr) == 0 && in evch_chunbind()
1157 (chp->ch_nevents == 0 || chp->ch_holdpend != CH_HOLD_PEND_INDEF)) { in evch_chunbind()
1164 mutex_exit(&chp->ch_mutex); in evch_chunbind()
1165 evch_dl_del(&eg->evch_list, &chp->ch_link); in evch_chunbind()
1166 evch_evq_destroy(chp->ch_queue); in evch_chunbind()
1167 if (chp->ch_propnvl) in evch_chunbind()
1168 nvlist_free(chp->ch_propnvl); in evch_chunbind()
1169 mutex_destroy(&chp->ch_mutex); in evch_chunbind()
1170 mutex_destroy(&chp->ch_pubmx); in evch_chunbind()
1171 cv_destroy(&chp->ch_pubcv); in evch_chunbind()
1172 kmem_free(chp->ch_name, chp->ch_namelen); in evch_chunbind()
1173 kmem_free(chp, sizeof (evch_chan_t)); in evch_chunbind()
1175 mutex_exit(&chp->ch_mutex); in evch_chunbind()
1205 evch_chan_t *chp = bp->bd_channel; in evch_chsubscribe() local
1206 evch_eventq_t *eqp = chp->ch_queue; in evch_chsubscribe()
1232 mutex_enter(&chp->ch_mutex); in evch_chsubscribe()
1233 if ((esp = (evch_subd_t *)evch_dl_search(&chp->ch_subscr, in evch_chsubscribe()
1252 mutex_exit(&chp->ch_mutex); in evch_chsubscribe()
1256 if (evch_dl_getnum(&chp->ch_subscr) >= chp->ch_maxsubscr) { in evch_chsubscribe()
1257 mutex_exit(&chp->ch_mutex); in evch_chsubscribe()
1261 if (flags & EVCH_SUB_DUMP && evch_dl_search(&chp->ch_subscr, in evch_chsubscribe()
1268 mutex_exit(&chp->ch_mutex); in evch_chsubscribe()
1315 evch_dl_add(&chp->ch_subscr, &sdp->sd_link); in evch_chsubscribe()
1316 if (chp->ch_holdpend && evch_dl_getnum(&chp->ch_subscr) == 1) { in evch_chsubscribe()
1321 mutex_exit(&chp->ch_mutex); in evch_chsubscribe()
1337 evch_chan_t *chp = bp->bd_channel; in evch_chunsubscribe() local
1339 mutex_enter(&chp->ch_mutex); in evch_chunsubscribe()
1340 if (chp->ch_holdpend) { in evch_chunsubscribe()
1341 evch_evq_stop(chp->ch_queue); /* Hold main event queue */ in evch_chunsubscribe()
1351 evch_evq_unsub(chp->ch_queue, sdp->sd_msub); in evch_chunsubscribe()
1360 evch_dl_del(&chp->ch_subscr, &sdp->sd_link); in evch_chunsubscribe()
1395 if (!(chp->ch_holdpend && evch_dl_getnum(&chp->ch_subscr) == 0)) { in evch_chunsubscribe()
1400 evch_evq_continue(chp->ch_queue); in evch_chunsubscribe()
1402 mutex_exit(&chp->ch_mutex); in evch_chunsubscribe()
1411 evch_chan_t *chp = bp->bd_channel; in evch_chpublish() local
1415 mutex_enter(&chp->ch_pubmx); in evch_chpublish()
1416 if (chp->ch_nevents >= chp->ch_maxev) { in evch_chpublish()
1419 mutex_exit(&chp->ch_pubmx); in evch_chpublish()
1422 while (chp->ch_nevents >= chp->ch_maxev) { in evch_chpublish()
1423 if (cv_wait_sig(&chp->ch_pubcv, in evch_chpublish()
1424 &chp->ch_pubmx) == 0) { in evch_chpublish()
1428 mutex_exit(&chp->ch_pubmx); in evch_chpublish()
1434 chp->ch_nevents++; in evch_chpublish()
1435 mutex_exit(&chp->ch_pubmx); in evch_chpublish()
1445 evch_evq_evadd_dest(ev, evch_destr_event, (void *)chp); in evch_chpublish()
1446 return (evch_evq_pub(chp->ch_queue, ev, flags) == 0 ? 0 : EAGAIN); in evch_chpublish()
1460 evch_chan_t *chp; in evch_chgetnames() local
1466 for (chp = evch_dl_next(&eg->evch_list, NULL); chp != NULL; in evch_chgetnames()
1467 chp = evch_dl_next(&eg->evch_list, chp)) { in evch_chgetnames()
1468 len += chp->ch_namelen; in evch_chgetnames()
1473 bcopy(chp->ch_name, addr, chp->ch_namelen); in evch_chgetnames()
1474 addr += chp->ch_namelen; in evch_chgetnames()
1492 evch_chan_t *chp; in evch_chgetchdata() local
1504 chp = (evch_chan_t *)evch_dl_search(&eg->evch_list, evch_namecmp, in evch_chgetchdata()
1506 if (chp == NULL) { in evch_chgetchdata()
1517 p->cd_uid = chp->ch_uid; in evch_chgetchdata()
1518 p->cd_gid = chp->ch_gid; in evch_chgetchdata()
1520 p->cd_ctime = chp->ch_ctime; in evch_chgetchdata()
1521 p->cd_maxev = chp->ch_maxev; in evch_chgetchdata()
1522 p->cd_evhwm = EVCH_EVQ_HIGHWM(chp->ch_queue); in evch_chgetchdata()
1523 p->cd_nevents = EVCH_EVQ_EVCOUNT(chp->ch_queue); in evch_chgetchdata()
1524 p->cd_maxsub = chp->ch_maxsubscr; in evch_chgetchdata()
1525 p->cd_nsub = evch_dl_getnum(&chp->ch_subscr); in evch_chgetchdata()
1526 p->cd_maxbinds = chp->ch_maxbinds; in evch_chgetchdata()
1527 p->cd_nbinds = chp->ch_bindings; in evch_chgetchdata()
1528 p->cd_holdpend = chp->ch_holdpend; in evch_chgetchdata()
1534 for (sdp = evch_dl_next(&chp->ch_subscr, NULL); sdp != NULL; in evch_chgetchdata()
1535 sdp = evch_dl_next(&chp->ch_subscr, sdp)) { in evch_chgetchdata()
1571 evch_chan_t *chp = bp->bd_channel; in evch_chsetpropnvl() local
1573 mutex_enter(&chp->ch_mutex); in evch_chsetpropnvl()
1575 if (chp->ch_propnvl) in evch_chsetpropnvl()
1576 nvlist_free(chp->ch_propnvl); in evch_chsetpropnvl()
1578 chp->ch_propnvl = nvl; in evch_chsetpropnvl()
1579 chp->ch_propnvlgen++; in evch_chsetpropnvl()
1581 mutex_exit(&chp->ch_mutex); in evch_chsetpropnvl()
1587 evch_chan_t *chp = bp->bd_channel; in evch_chgetpropnvl() local
1590 mutex_enter(&chp->ch_mutex); in evch_chgetpropnvl()
1592 if (chp->ch_propnvl != NULL) in evch_chgetpropnvl()
1593 rc = (nvlist_dup(chp->ch_propnvl, nvlp, 0) == 0) ? 0 : ENOMEM; in evch_chgetpropnvl()
1598 *genp = chp->ch_propnvlgen; in evch_chgetpropnvl()
1600 mutex_exit(&chp->ch_mutex); in evch_chgetpropnvl()
1627 evch_chrdevent_init(evch_chan_t *chp, char *subid) in evch_chrdevent_init() argument
1638 evch_chan = chp; in evch_chrdevent_init()
1641 if ((sdp = (evch_subd_t *)evch_dl_search(&chp->ch_subscr, in evch_chrdevent_init()
1647 mutex_enter(&chp->ch_mutex); in evch_chrdevent_init()
1648 sdp = (evch_subd_t *)evch_dl_search(&chp->ch_subscr, compfunc, subid); in evch_chrdevent_init()
1653 pmqstat = evch_evq_status(chp->ch_queue); in evch_chrdevent_init()
1655 evch_evq_stop(chp->ch_queue); in evch_chrdevent_init()
1678 while ((ev = evch_evq_evnext(chp->ch_queue, ev)) != NULL) { in evch_chrdevent_init()
1688 evch_evq_continue(chp->ch_queue); in evch_chrdevent_init()
1689 mutex_exit(&chp->ch_mutex); in evch_chrdevent_init()
1981 evch_chan_t *chp = ((evch_bind_t *)scp)->bd_channel; in sysevent_evc_control() local
1992 mutex_enter(&chp->ch_mutex); in sysevent_evc_control()
1996 *chlenp = chp->ch_maxev; in sysevent_evc_control()
2000 ochlen = chp->ch_maxev; in sysevent_evc_control()
2001 chp->ch_maxev = min(chlen, evch_events_max); in sysevent_evc_control()
2002 if (ochlen < chp->ch_maxev) { in sysevent_evc_control()
2003 cv_signal(&chp->ch_pubcv); in sysevent_evc_control()
2013 mutex_exit(&chp->ch_mutex); in sysevent_evc_control()
2282 evch_chan_t *chp = ((evch_bind_t *)bp)->bd_channel; in evch_usrcontrol_set() local
2286 mutex_enter(&chp->ch_mutex); in evch_usrcontrol_set()
2289 if (uid && uid != chp->ch_uid) { in evch_usrcontrol_set()
2293 chp->ch_maxev = min(value, evch_events_max); in evch_usrcontrol_set()
2298 mutex_exit(&chp->ch_mutex); in evch_usrcontrol_set()
2306 evch_chan_t *chp = ((evch_bind_t *)bp)->bd_channel; in evch_usrcontrol_get() local
2309 mutex_enter(&chp->ch_mutex); in evch_usrcontrol_get()
2312 *value = chp->ch_maxev; in evch_usrcontrol_get()
2320 mutex_exit(&chp->ch_mutex); in evch_usrcontrol_get()