Lines Matching refs:stp

425 ses_ssl_alloc(topo_mod_t *mod, ses_enum_target_t *stp)  in ses_ssl_alloc()  argument
431 topo_mod_dprintf(mod, "ssl_alloc %p", stp); in ses_ssl_alloc()
432 ssl->ssl_tgt = stp; in ses_ssl_alloc()
439 ses_ssl_free(topo_mod_t *mod, ses_enum_target_t *stp) in ses_ssl_free() argument
446 if (ssl->ssl_tgt == stp) { in ses_ssl_free()
461 ses_ssl_valid(ses_enum_target_t *stp) in ses_ssl_valid() argument
466 if (ssl->ssl_tgt == stp) in ses_ssl_valid()
516 ses_enum_target_t *stp; in ses_contract_thread() local
575 stp = (ses_enum_target_t *)(uintptr_t) in ses_contract_thread()
581 if (ses_ssl_valid(stp) == 0) { in ses_contract_thread()
599 (void) pthread_mutex_lock(&stp->set_lock); in ses_contract_thread()
606 if (stp->set_target) { in ses_contract_thread()
608 ses_snap_rele(stp->set_snap); in ses_contract_thread()
609 ses_close(stp->set_target); in ses_contract_thread()
610 stp->set_target = NULL; in ses_contract_thread()
616 if (stp->set_ctid) { in ses_contract_thread()
618 "abandon old contract %d", stp->set_ctid); in ses_contract_thread()
620 stp->set_ctid = 0; in ses_contract_thread()
625 (void) pthread_mutex_unlock(&stp->set_lock); in ses_contract_thread()
737 ses_create_contract(topo_mod_t *mod, ses_enum_target_t *stp) in ses_create_contract() argument
742 stp->set_ctid = 0; in ses_create_contract()
745 if ((len = readlink(stp->set_devpath, link_path, PATH_MAX)) < 0) { in ses_create_contract()
754 (void) ct_tmpl_set_cookie(tfd, (uint64_t)(uintptr_t)stp); in ses_create_contract()
760 else if ((rval = ct_tmpl_create(tfd, &stp->set_ctid)) != 0) in ses_create_contract()
763 topo_mod_dprintf(mod, "created ctid=%" _PRIdID, stp->set_ctid); in ses_create_contract()
768 ses_target_free(topo_mod_t *mod, ses_enum_target_t *stp) in ses_target_free() argument
770 if (--stp->set_refcount == 0) { in ses_target_free()
772 (void) pthread_mutex_lock(&stp->set_lock); in ses_target_free()
773 if (stp->set_target) { in ses_target_free()
774 ses_snap_rele(stp->set_snap); in ses_target_free()
775 ses_close(stp->set_target); in ses_target_free()
776 stp->set_target = NULL; in ses_target_free()
778 if (stp->set_ctid) { in ses_target_free()
783 stp->set_ctid); in ses_target_free()
786 stp->set_ctid); in ses_target_free()
790 stp->set_ctid = 0; in ses_target_free()
792 (void) pthread_mutex_unlock(&stp->set_lock); in ses_target_free()
793 ses_ssl_free(mod, stp); in ses_target_free()
794 topo_mod_strfree(mod, stp->set_devpath); in ses_target_free()
795 topo_mod_free(mod, stp, sizeof (ses_enum_target_t)); in ses_target_free()
2366 ses_enum_target_t *stp; in ses_create_subchassis() local
2447 for (i = 0, stp = topo_list_next(&scp->sec_targets); stp != NULL; in ses_create_subchassis()
2448 stp = topo_list_next(stp), i++) in ses_create_subchassis()
2454 for (i = 0, stp = topo_list_next(&scp->sec_targets); stp != NULL; in ses_create_subchassis()
2455 stp = topo_list_next(stp), i++) in ses_create_subchassis()
2456 paths[i] = stp->set_devpath; in ses_create_subchassis()
2920 ses_enum_target_t *stp; in ses_create_chassis() local
3033 for (i = 0, stp = topo_list_next(&cp->sec_targets); stp != NULL; in ses_create_chassis()
3034 stp = topo_list_next(stp), i++) in ses_create_chassis()
3040 for (i = 0, stp = topo_list_next(&cp->sec_targets); stp != NULL; in ses_create_chassis()
3041 stp = topo_list_next(stp), i++) in ses_create_chassis()
3042 paths[i] = stp->set_devpath; in ses_create_chassis()
3600 ses_enum_target_t *stp; in ses_process_dir() local
3625 if ((stp = topo_mod_zalloc(mod, in ses_process_dir()
3629 (void) pthread_mutex_init(&stp->set_lock, NULL); in ses_process_dir()
3639 if ((stp->set_devpath = topo_mod_strdup(mod, path)) == NULL) { in ses_process_dir()
3640 topo_mod_free(mod, stp, sizeof (ses_enum_target_t)); in ses_process_dir()
3644 if ((stp->set_target = in ses_process_dir()
3648 ses_sof_alloc(mod, stp->set_devpath); in ses_process_dir()
3649 topo_mod_free(mod, stp, sizeof (ses_enum_target_t)); in ses_process_dir()
3653 ses_ssl_alloc(mod, stp); in ses_process_dir()
3654 ses_create_contract(mod, stp); in ses_process_dir()
3656 stp->set_refcount = 1; in ses_process_dir()
3657 sdp->sed_target = stp; in ses_process_dir()
3658 stp->set_snap = ses_snap_hold(stp->set_target); in ses_process_dir()
3659 stp->set_snaptime = gethrtime(); in ses_process_dir()
3668 (void) ses_walk(stp->set_snap, ses_enum_gather, sdp); in ses_process_dir()
3769 ses_enum_target_t *stp; in ses_release() local
3771 if ((stp = topo_node_getspecific(tn)) != NULL) { in ses_release()
3773 ses_target_free(mod, stp); in ses_release()