Lines Matching defs:dnode

119  * NOTE: the io and storage groups won't be present if the dnode passed in is
125 tnode_t *dtn, dev_di_node_t *dnode)
171 /* no dnode was found for this disk - skip the io and storage groups */
172 if (dnode == NULL) {
179 dnode->ddn_dpath, dnode->ddn_devid)) == NULL) {
199 TOPO_PROP_IMMUTABLE, dnode->ddn_dpath, &err) != 0) {
205 if (dnode->ddn_devid && topo_prop_set_string(dtn, TOPO_PGROUP_IO,
206 TOPO_IO_DEVID, TOPO_PROP_IMMUTABLE, dnode->ddn_devid, &err) != 0) {
212 if (dnode->ddn_ppath_count != 0 &&
214 TOPO_PROP_IMMUTABLE, (const char **)dnode->ddn_ppath,
215 dnode->ddn_ppath_count, &err) != 0) {
222 if (dnode->ddn_lpath != NULL &&
225 dnode->ddn_lpath, &err) != 0) {
232 if (dnode->ddn_mfg && (topo_prop_set_string(dtn, TOPO_PGROUP_STORAGE,
234 dnode->ddn_mfg, &err) != 0)) {
239 if (dnode->ddn_model && (topo_prop_set_string(dtn, TOPO_PGROUP_STORAGE,
241 dnode->ddn_model, &err) != 0)) {
246 if (dnode->ddn_serial && (topo_prop_set_string(dtn, TOPO_PGROUP_STORAGE,
248 dnode->ddn_serial, &err) != 0)) {
253 if (dnode->ddn_firm && (topo_prop_set_string(dtn, TOPO_PGROUP_STORAGE,
255 dnode->ddn_firm, &err) != 0)) {
260 if (dnode->ddn_cap && (topo_prop_set_string(dtn, TOPO_PGROUP_STORAGE,
262 dnode->ddn_cap, &err) != 0)) {
334 dev_di_node_t *dnode, const char *name, topo_instance_t i, tnode_t **rval)
344 if (dnode != NULL) {
345 mfg = disk_auth_clean(mod, dnode->ddn_mfg);
346 model = disk_auth_clean(mod, dnode->ddn_model);
347 firm = disk_auth_clean(mod, dnode->ddn_firm);
348 serial = disk_auth_clean(mod, dnode->ddn_serial);
398 if (disk_set_props(mod, parent, dtn, dnode) != 0) {
411 disk_declare(topo_mod_t *mod, tnode_t *parent, dev_di_node_t *dnode,
417 rval = disk_tnode_create(mod, parent, dnode, DISK, 0, &dtn);
444 dev_di_node_t *dnode;
451 for (dnode = topo_list_next(listp); dnode != NULL;
452 dnode = topo_list_next(dnode)) {
453 if (dnode->ddn_ppath == NULL)
456 for (i = 0; i < dnode->ddn_ppath_count; i++) {
457 if (di_devfs_path_match(dnode->ddn_ppath[0], path))
458 return (disk_declare(mod, parent, dnode, NULL));
471 dev_di_node_t *dnode;
475 for (dnode = topo_list_next(listp); dnode != NULL;
476 dnode = topo_list_next(dnode)) {
477 if (dnode->ddn_target_port == NULL)
480 for (i = 0; i < dnode->ddn_ppath_count; i++) {
481 if ((dnode->ddn_target_port[i] != NULL) &&
482 (strncmp(dnode->ddn_target_port[i], addr,
483 strcspn(dnode->ddn_target_port[i], ":"))) == 0) {
486 return (disk_declare(mod, parent, dnode,
514 dev_di_node_t *dnode = cbp->dcb_dnode;
519 if ((dnode == NULL) || (devpath == NULL))
528 dnode->ddn_lpath = topo_mod_strdup(mod, ctds ? ctds + 1 : devpath);
536 dev_di_node_free(topo_mod_t *mod, dev_di_node_t *dnode)
541 if (dnode->ddn_devid)
542 topo_mod_strfree(mod, dnode->ddn_devid);
543 for (i = 0; i < dnode->ddn_ppath_count; i++) {
545 topo_mod_strfree(mod, dnode->ddn_ppath[i]);
546 topo_mod_strfree(mod, dnode->ddn_target_port[i]);
547 topo_mod_strfree(mod, dnode->ddn_attached_port[i]);
548 topo_mod_strfree(mod, dnode->ddn_bridge_port[i]);
550 topo_mod_free(mod, dnode->ddn_ppath,
551 dnode->ddn_ppath_count * sizeof (char *));
552 topo_mod_free(mod, dnode->ddn_target_port,
553 dnode->ddn_ppath_count * sizeof (char *));
554 topo_mod_free(mod, dnode->ddn_attached_port,
555 dnode->ddn_ppath_count * sizeof (char *));
556 topo_mod_free(mod, dnode->ddn_bridge_port,
557 dnode->ddn_ppath_count * sizeof (char *));
558 topo_mod_strfree(mod, dnode->ddn_dpath);
559 topo_mod_strfree(mod, dnode->ddn_lpath);
561 topo_mod_strfree(mod, dnode->ddn_mfg);
562 topo_mod_strfree(mod, dnode->ddn_model);
563 topo_mod_strfree(mod, dnode->ddn_serial);
564 topo_mod_strfree(mod, dnode->ddn_firm);
565 topo_mod_strfree(mod, dnode->ddn_cap);
568 topo_mod_free(mod, dnode, sizeof (dev_di_node_t));
575 dev_di_node_t *dnode;
597 for (dnode = topo_list_next(cbp->dcb_list);
598 dnode != NULL; dnode = topo_list_next(dnode)) {
599 if (dnode->ddn_devid &&
600 devid_str_compare(dnode->ddn_devid, devid) == 0) {
608 if ((dnode = topo_mod_zalloc(mod, sizeof (dev_di_node_t))) == NULL)
613 dnode->ddn_devid = topo_mod_strdup(mod, devid);
614 if (dnode->ddn_devid == NULL)
624 dnode->ddn_dpath = topo_mod_strdup(mod, path);
626 if (dnode->ddn_dpath == NULL)
654 if ((dnode->ddn_ppath =
658 dnode->ddn_ppath_count = 1;
659 if ((dnode->ddn_ppath[0] = topo_mod_strdup(mod,
660 dnode->ddn_dpath)) == NULL)
663 if ((dnode->ddn_target_port = topo_mod_zalloc(mod,
667 if ((dnode->ddn_attached_port = topo_mod_zalloc(mod,
671 if ((dnode->ddn_bridge_port = topo_mod_zalloc(mod,
678 if ((dnode->ddn_target_port[0] =
688 if ((dnode->ddn_attached_port[0] =
698 if ((dnode->ddn_bridge_port[0] =
707 if ((dnode->ddn_ppath = topo_mod_zalloc(mod,
711 dnode->ddn_ppath_count = pathcount;
713 if ((dnode->ddn_target_port = topo_mod_zalloc(mod,
717 if ((dnode->ddn_attached_port = topo_mod_zalloc(mod,
721 if ((dnode->ddn_bridge_port = topo_mod_zalloc(mod,
734 dnode->ddn_ppath[pathcount] =
737 if (dnode->ddn_ppath[pathcount] == NULL)
742 if ((dnode->ddn_target_port[pathcount] =
751 if ((dnode->ddn_attached_port[pathcount] =
760 if ((dnode->ddn_bridge_port[pathcount] =
777 dnode->ddn_dtype = *inq_dtype;
780 mlen = strlen(dnode->ddn_dpath) + strlen(extn) + 1;
784 dnode->ddn_dpath, extn);
785 cbp->dcb_dnode = dnode;
790 if (dnode->ddn_lpath == NULL) {
796 dnode->ddn_dtype = DTYPE_UNKNOWN;
802 if ((dnode->ddn_mfg = disk_trim_whitespace(mod, s)) == NULL)
807 if ((dnode->ddn_model = disk_trim_whitespace(mod, s)) == NULL)
812 if ((dnode->ddn_firm = disk_trim_whitespace(mod, s)) == NULL)
817 if ((dnode->ddn_serial = disk_trim_whitespace(mod, s)) == NULL)
834 if ((dnode->ddn_cap = topo_mod_strdup(mod, lentry)) == NULL)
839 "adding %s\n", devid ? dnode->ddn_devid : "NULL devid");
841 " %s\n", dnode->ddn_dpath);
842 for (i = 0; i < dnode->ddn_ppath_count; i++) {
844 " %s\n", dnode->ddn_ppath[i]);
846 topo_list_append(cbp->dcb_list, dnode);
850 dev_di_node_free(mod, dnode);
918 dev_di_node_t *dnode;
920 while ((dnode = topo_list_next(listp)) != NULL) {
922 topo_list_delete(listp, dnode);
923 dev_di_node_free(mod, dnode);