Lines Matching defs:cmnp

593 	cache_minor_t *cmnp;
612 cmnp = minor_insert(hdp, pcnp, name, nodetype, NULL);
613 if (cmnp == NULL) {
619 cmnp->name);
621 if (read_links(hdp, cmnp, dmp->link) != 0) {
864 cache_minor_t *cmnp,
875 cmnp ? cmnp->name : "<NULL>");
880 for (; cmnp != NULL; cmnp = cmnp->sib) {
882 assert(cmnp->name != NULL);
890 dmp->name = write_string(hdp, cmnp->name, next);
891 dmp->nodetype = write_string(hdp, cmnp->nodetype, next);
905 cmnp->name);
907 if (write_links(hdp, dmp, cmnp->link, next) != 0) {
912 return (cmnp ? -1 : 0);
1112 cache_minor_t *cmnp;
1124 cmnp = (*pp)->minor;
1125 (*pp)->minor = cmnp->sib;
1127 while (cmnp->link != NULL) {
1128 clp = cmnp->link;
1129 cmnp->link = clp->sib;
1133 minor_free(hdp, &cmnp);
1291 cache_minor_t *cmnp;
1296 if ((cmnp = link2minor(hdp, clp)) != NULL) {
1298 clp->sib = cmnp->link;
1299 cmnp->link = clp;
1301 clp->minor = cmnp;
1331 cache_minor_t *cmnp = *pp;
1335 if (cmnp == NULL)
1338 if (CACHE_LAST(hdp) == cmnp) {
1339 dprintf(DBG_STEP, "minor_free: last_minor(%s)\n", cmnp->name);
1343 free(cmnp->name);
1344 free(cmnp->nodetype);
1345 free(cmnp);
1503 cache_minor_t *cmnp;
1517 cmnp = CACHE_LAST(hdp);
1518 if (strcmp(cmnp->name, minor_name) == 0 && cmnp->node &&
1519 strcmp(cmnp->node->path, devfs_path) == 0) {
1520 return (cmnp);
1523 cmnp = cmnp->sib;
1524 if (cmnp && strcmp(cmnp->name, minor_name) == 0 && cmnp->node &&
1525 strcmp(cmnp->node->path, devfs_path) == 0) {
1526 set_last_minor(hdp, cmnp, TYPE_CACHE);
1527 return (cmnp);
1534 set_last_minor(struct di_devlink_handle *hdp, cache_minor_t *cmnp, int flags)
1544 if (LOOKUP_CACHE(flags) && cmnp) {
1545 CACHE_LAST(hdp) = cmnp;
1646 minor_delete(di_devlink_handle_t hdp, cache_minor_t *cmnp)
1652 (void) dprintf(DBG_STEP, "%s: removing minor: %s\n", fcn, cmnp->name);
1655 if (cmnp->node != NULL) {
1656 mpp = &cmnp->node->minor;
1658 if (*mpp == cmnp)
1664 fcn, cmnp->name);
1666 *mpp = cmnp->sib;
1670 cmnp->name);
1673 delete_unused_nodes(hdp, cmnp->node);
1675 cmnp->node = NULL;
1676 cmnp->sib = NULL;
1679 for (lpp = &cmnp->link; *lpp != NULL; lpp = &(*lpp)->sib) {
1683 CACHE(hdp)->dngl = cmnp->link;
1684 cmnp->link = NULL;
1686 minor_free(hdp, &cmnp);
1801 delete_unused_minor(di_devlink_handle_t hdp, cache_minor_t *cmnp)
1803 if (cmnp == NULL)
1806 if (cmnp->link != NULL)
1810 cmnp->name);
1812 minor_delete(hdp, cmnp);
1834 cache_minor_t *cmnp;
1863 if ((cmnp = lookup_minor(hdp, minor_path, NULL,
1874 cmnp = NULL;
1878 return (link_insert(hdp, cmnp, link, content, attr));
2710 cache_minor_t *cmnp;
2725 if ((cmnp = calloc(1, sizeof (cache_minor_t))) == NULL) {
2730 cmnp->name = strdup(name);
2731 cmnp->nodetype = strdup(nodetype);
2732 if (cmnp->name == NULL || cmnp->nodetype == NULL) {
2734 free(cmnp->name);
2735 free(cmnp->nodetype);
2736 free(cmnp);
2740 cmnp->node = pcnp;
2744 cmnp->sib = pcnp->minor;
2745 pcnp->minor = cmnp;
2748 *prev = cmnp;
2751 return (cmnp);
2757 cache_minor_t *cmnp,
2785 clp->minor = cmnp;
2788 if (cmnp != NULL) {
2789 clp->sib = cmnp->link;
2790 cmnp->link = clp;
2987 cache_minor_t *cmnp;
2995 for (cmnp = cnp->minor; cmnp != NULL; cmnp = cmnp->sib) {
2996 count_minor(cmnp, count);
3006 count_minor(cache_minor_t *cmnp, uint32_t *count)
3010 if (cmnp == NULL)
3014 count_string(cmnp->name, count);
3015 count_string(cmnp->nodetype, count);
3017 for (clp = cmnp->link; clp != NULL; clp = clp->sib) {
3625 cache_minor_t *cmnp;
3629 if ((cmnp = lookup_minor(hdp, mpath, NULL, TYPE_CACHE)) != NULL) {
3630 (void) walk_cache_links(hdp, cmnp->link, linkp);
3639 cache_minor_t *cmnp;
3649 for (cmnp = cnp->minor; cmnp != NULL; cmnp = cmnp->sib) {
3650 if (walk_cache_links(hdp, cmnp->link, linkp)