Lines Matching refs:libp
145 plugin_lib_t *libp; member
189 cfga_err_t (*resolve_lib)(plugin_lib_t *libp);
244 static cfga_err_t null_resolve(plugin_lib_t *libp);
245 static cfga_err_t resolve_v1(plugin_lib_t *libp);
246 static cfga_err_t resolve_v2(plugin_lib_t *libp);
252 plugin_lib_t *libp, lib_loc_t *liblocp);
254 plugin_lib_t *libp, lib_loc_t *liblocp);
256 plugin_lib_t *libp, lib_loc_t *liblocp);
388 plugin_lib_t *libp; in config_change_state() local
418 libloc.libp = NULL; in config_change_state()
424 libp = libloc.libp; in config_change_state()
430 retval = (*libp->cfga_change_state_p) in config_change_state()
438 if ((retval = libp->vers_ops->get_cond(&libloc, &cond, in config_change_state()
446 (*libp->cfga_change_state_p)( in config_change_state()
455 rele_lib(libp); in config_change_state()
497 libloc.libp = NULL; in config_private_func()
504 retval = (*libloc.libp->cfga_private_func_p)(function, in config_private_func()
507 rele_lib(libloc.libp); in config_private_func()
548 libloc.libp = NULL; in config_test()
555 retval = (*libloc.libp->cfga_test_p)(libloc.ap_physical, in config_test()
557 rele_lib(libloc.libp); in config_test()
780 plugin_lib_t *libp, *prev = &plugin_list, *next = NULL; in config_unload_libs() local
786 for (libp = plugin_list.next; libp != NULL; libp = next) { in config_unload_libs()
787 next = libp->next; in config_unload_libs()
788 (void) mutex_lock(&libp->lock); in config_unload_libs()
789 if (libp->refcnt) { in config_unload_libs()
790 (void) mutex_unlock(&libp->lock); in config_unload_libs()
791 prev = libp; in config_unload_libs()
794 (void) mutex_unlock(&libp->lock); in config_unload_libs()
796 (void) dlclose(libp->handle); in config_unload_libs()
797 (void) mutex_destroy(&libp->lock); in config_unload_libs()
798 free(libp); in config_unload_libs()
856 libloc.libp = NULL; in config_ap_id_cmp()
861 ret = (*libloc.libp->cfga_ap_id_cmp_p)(ap1, ap2); in config_ap_id_cmp()
863 rele_lib(libloc.libp); in config_ap_id_cmp()
917 libloc.libp = NULL; in config_help()
924 retval = (*libloc.libp->cfga_help_p)(msgp, options, flags); in config_help()
925 rele_lib(libloc.libp); in config_help()
1053 plugin_lib_t *libp, in null_mklog() argument
1063 plugin_lib_t *libp, in mklog_v1() argument
1070 if (libp->plugin_vers != CFGA_HSL_V1) { in mklog_v1()
1095 plugin_lib_t *libp, in mklog_v2() argument
1103 if (libp->plugin_vers != CFGA_HSL_V2) { in mklog_v2()
1159 plugin_lib_t *libp, in mklog_hp() argument
1185 plugin_lib_t *libp, in resolve_lib_ref() argument
1189 void *libhdlp = libp->handle; in resolve_lib_ref()
1212 libp->plugin_vers = plug_vers; in resolve_lib_ref()
1213 libp->vers_ops = &cfga_vers_ops[plug_vers]; in resolve_lib_ref()
1220 libp->cfga_change_state_p = (cfga_err_t (*)(cfga_cmd_t, in resolve_lib_ref()
1228 libp->cfga_private_func_p = (cfga_err_t (*)(const char *, in resolve_lib_ref()
1236 libp->cfga_test_p = (cfga_err_t (*)(const char *, const char *, in resolve_lib_ref()
1243 libp->cfga_help_p = (cfga_err_t (*)(struct cfga_msg *, in resolve_lib_ref()
1247 libp->cfga_ap_id_cmp_p = default_ap_id_cmp; in resolve_lib_ref()
1249 libp->cfga_ap_id_cmp_p = (int (*)(const in resolve_lib_ref()
1253 return (libp->vers_ops->resolve_lib(libp)); in resolve_lib_ref()
1258 null_resolve(plugin_lib_t *libp) in null_resolve() argument
1264 resolve_v1(plugin_lib_t *libp) in resolve_v1() argument
1266 void *sym, *libhdlp = libp->handle; in resolve_v1()
1269 if (libp->plugin_vers != CFGA_HSL_V1) { in resolve_v1()
1277 libp->cfga_stat_p = (cfga_err_t (*)(const char *, in resolve_v1()
1285 libp->cfga_list_p = (cfga_err_t (*)(struct cfga_stat_data **, in resolve_v1()
1292 resolve_v2(plugin_lib_t *libp) in resolve_v2() argument
1297 if (libp->plugin_vers != CFGA_HSL_V2) { in resolve_v2()
1301 if ((sym = dlsym(libp->handle, "cfga_list_ext")) == NULL) { in resolve_v2()
1305 libp->cfga_list_ext_p = (cfga_err_t (*)(const char *, in resolve_v2()
1353 lib_loc_p->libp = NULL; in config_get_lib()
1436 plugin_lib_t *libp; in config_get_lib() local
1438 libp = lib_loc_p->libp; in config_get_lib()
1441 assert(strcmp(libp->libpath, lib_loc_p->pathname) == 0); in config_get_lib()
1442 assert(VALID_HSL_VERS(libp->plugin_vers)); in config_get_lib()
1448 assert(dyncomp == NULL || libp->plugin_vers >= CFGA_HSL_V2); in config_get_lib()
1468 lib_loc_p->libp = NULL; in config_get_lib()
1471 assert(ret != CFGA_OK || lib_loc_p->libp != NULL); in config_get_lib()
1508 plugin_lib_t *libp, *list_libp; in load_lib_impl() local
1534 libloc_p->libp = libp = list_libp; in load_lib_impl()
1536 if (libp->vers_ops->mklog(node, minor, libp, libloc_p) in load_lib_impl()
1542 if (mklog_hp(node, hp, libp, libloc_p) != CFGA_OK) { in load_lib_impl()
1557 libp = config_calloc_check(1, sizeof (plugin_lib_t), NULL); in load_lib_impl()
1558 if (libp == NULL) { in load_lib_impl()
1563 (void) snprintf(libp->libpath, sizeof (libp->libpath), "%s", in load_lib_impl()
1569 libp->handle = dlopen(libp->libpath, RTLD_NOW); in load_lib_impl()
1570 if (libp->handle == NULL) { in load_lib_impl()
1572 free(libp); in load_lib_impl()
1577 if (resolve_lib_ref(libp, libloc_p) != CFGA_OK || in load_lib_impl()
1578 libp->vers_ops->mklog(node, minor, libp, libloc_p) in load_lib_impl()
1581 (void) dlclose(libp->handle); in load_lib_impl()
1582 free(libp); in load_lib_impl()
1586 if (resolve_lib_ref(libp, libloc_p) != CFGA_OK || in load_lib_impl()
1587 mklog_hp(node, hp, libp, libloc_p) != CFGA_OK) { in load_lib_impl()
1589 (void) dlclose(libp->handle); in load_lib_impl()
1590 free(libp); in load_lib_impl()
1601 libp->next = list_libp->next; in load_lib_impl()
1602 list_libp->next = libp; in load_lib_impl()
1605 libp->refcnt = 1; in load_lib_impl()
1606 (void) mutex_init(&libp->lock, USYNC_THREAD, NULL); in load_lib_impl()
1613 libloc_p->libp = libp; in load_lib_impl()
1855 plugin_lib_t *libp = entry->lc_libp; in lookup_cache() local
1856 libloc_p->libp = libp; in lookup_cache()
1857 hold_lib(libp); in lookup_cache()
1858 (void) strcpy(libloc_p->pathname, libp->libpath); in lookup_cache()
1894 entry->lc_libp = libloc_p->libp; in update_cache()
1994 libloc_p->libp = NULL; in find_ap_common()
2005 if (libloc_p->libp == NULL) { in find_ap_common()
2029 libloc_p->libp = NULL; in find_ap_common()
2041 if (libloc_p->libp != NULL) { in find_ap_common()
2299 plugin_lib_t *libp = NULL; in lib_in_list() local
2301 for (libp = plugin_list.next; libp != NULL; libp = libp->next) { in lib_in_list()
2302 if (strncmp(libpath, libp->libpath, MAXPATHLEN) == 0) { in lib_in_list()
2303 return (libp); in lib_in_list()
2624 plugin_lib_t *libp; in do_list_common_impl() local
2633 lib_loc.libp = NULL; in do_list_common_impl()
2662 libp = lib_loc.libp; in do_list_common_impl()
2663 assert(libp != NULL); in do_list_common_impl()
2670 if (compat_plugin(&lstatp->use_vers, libp->plugin_vers)) { in do_list_common_impl()
2672 (void) libp->vers_ops->stat_plugin(lstatp, in do_list_common_impl()
2683 ret = libp->vers_ops->stat_plugin(lstatp, in do_list_common_impl()
2698 rele_lib(libp); in do_list_common_impl()
2715 plugin_lib_t *libp; in stat_common() local
2723 libloc.libp = NULL; in stat_common()
2728 assert(libloc.libp != NULL); in stat_common()
2729 libp = libloc.libp; in stat_common()
2735 rele_lib(libp); in stat_common()
2744 rc = libp->vers_ops->stat_plugin(lstatp, &libloc, in stat_common()
2746 rele_lib(libp); in stat_common()
2787 if ((rc = (*(libloc_p->libp->cfga_stat_p))(libloc_p->ap_physical, in stat_plugin_v1()
2846 if ((rc = (*(libloc_p->libp->cfga_list_ext_p))( in stat_plugin_v2()
3027 plugin_lib_t *libp; in get_cond_v1() local
3032 libp = liblocp->libp; in get_cond_v1()
3033 if (libp->plugin_vers != CFGA_HSL_V1) { in get_cond_v1()
3038 if ((rc = (*liblocp->libp->cfga_stat_p)( in get_cond_v1()
3053 plugin_lib_t *libp; in get_cond_v2() local
3058 libp = liblocp->libp; in get_cond_v2()
3059 if (libp->plugin_vers != CFGA_HSL_V2) { in get_cond_v2()
3066 if ((rc = (*liblocp->libp->cfga_list_ext_p)( in get_cond_v2()
3272 hold_lib(plugin_lib_t *libp) in hold_lib() argument
3274 assert(libp->refcnt >= 0); in hold_lib()
3275 (void) mutex_lock(&libp->lock); in hold_lib()
3276 libp->refcnt++; in hold_lib()
3277 (void) mutex_unlock(&libp->lock); in hold_lib()
3281 rele_lib(plugin_lib_t *libp) in rele_lib() argument
3283 assert(libp->refcnt > 0); in rele_lib()
3284 (void) mutex_lock(&libp->lock); in rele_lib()
3285 libp->refcnt--; in rele_lib()
3286 (void) mutex_unlock(&libp->lock); in rele_lib()