Lines Matching defs:link

69  * allows link generators like devfsadm(1M) and ucblinks(1B) (writers) to
78 * are complete, the link generator calls di_devlink_close() which writes
120 * walks through every link in the link segment.
617 if (read_links(hdp, cmnp, dmp->link) != 0) {
626 * If the link is dangling the corresponding minor will be absent.
656 (void) dprintf(DBG_STEP, "read_links: link[%u]: %s%s\n",
903 if (write_links(hdp, dmp, cmnp->link, next) != 0) {
926 (void) dprintf(DBG_ERR, "%s: invalid minor for link\n", fcn);
936 (void) dprintf(DBG_ERR, "%s: invalid minor for link"
958 /* Commit writes to this link */
962 dlp->sib = pdmp->link;
963 pdmp->link = idx;
969 (void) dprintf(DBG_STEP, "%s: link[%u]: %s%s\n", fcn, idx,
1123 while (cmnp->link != NULL) {
1124 clp = cmnp->link;
1125 cmnp->link = clp->sib;
1157 dprintf(DBG_ERR, "rm_link_from_hash: link(%s) not found\n", clp->path);
1161 link_hash(di_devlink_handle_t hdp, const char *link, uint_t flags)
1166 if (link == NULL)
1169 hval = hashfn(hdp, link);
1172 if (strcmp(clp->path, link) == 0) {
1193 char *cp, buf[PATH_MAX], link[PATH_MAX];
1199 * For primary link, content should point to a /devices node.
1211 * If secondary, the primary link is derived from the secondary
1212 * link contents. Secondary link contents can have two formats:
1234 * Lookup the primary link if possible and find its minor.
1242 (void) snprintf(link, sizeof (link), "%s/%s", hdp->dev_dir, clp->path);
1250 * A realpath attempt to lookup a dangling link can invoke implicit
1251 * reconfig so verify there's an actual device behind the link first.
1253 if (lstat(link, &st) == -1)
1256 if (s_readlink(link, buf, sizeof (buf)) < 0)
1261 if (strlcpy(abspath, link, n) >= n)
1277 if (s_realpath(link, buf) == NULL || !is_minor_node(buf, &minor_path)) {
1294 clp->sib = cmnp->link;
1295 cmnp->link = clp;
1299 dprintf(DBG_INFO, "resolve_dangling_links: link(%s):"
1675 for (lpp = &cmnp->link; *lpp != NULL; lpp = &(*lpp)->sib) {
1679 CACHE(hdp)->dngl = cmnp->link;
1680 cmnp->link = NULL;
1729 rm_link(di_devlink_handle_t hdp, const char *link)
1734 if (hdp == NULL || DB_ERR(hdp) || link == NULL || link[0] == '/' ||
1737 fcn, link ? link : "<NULL>");
1742 dprintf(DBG_STEP, "%s: link(%s)\n", fcn, link);
1744 if ((clp = link_hash(hdp, link, UNLINK_FROM_HASH)) == NULL) {
1754 di_devlink_rm_link(di_devlink_handle_t hdp, const char *link)
1761 return (rm_link(hdp, link));
1770 (void) dprintf(DBG_STEP, "%s: removing link: %s\n", fcn, clp->path);
1775 pp = &clp->minor->link;
1783 (void) dprintf(DBG_ERR, "%s: link(%s) not on list\n",
1802 if (cmnp->link != NULL)
1814 const char *link,
1818 return (add_link(hdp, link, content, flags) != NULL ? 0 : -1);
1824 const char *link,
1833 if (hdp == NULL || DB_ERR(hdp) || link == NULL ||
1834 link[0] == '/' || content == NULL || !link_flag(flags) ||
1837 fcn, link ? link : "<NULL>");
1842 if ((clp = link_hash(hdp, link, 0)) != NULL) {
1844 (void) rm_link(hdp, link);
1855 " for primary link\n", fcn, content);
1866 * Defer resolving a secondary link to a minor until the
1867 * database is closed. This ensures that the primary link
1874 return (link_insert(hdp, cmnp, link, content, attr));
1922 * Walk through $ROOT/dev, reading every link and marking the
1939 * The link is stale, so remove it. Since the link
1940 * will be destroyed, use a copy of the link path to
1945 (void) dprintf(DBG_STEP, "%s: removing invalid link:"
2199 cache_dev_link(struct di_devlink_handle *hdp, void *data, const char *link)
2207 if (s_readlink(link, content, sizeof (content)) < 0) {
2217 assert(strncmp(link, hdp->dev_dir, strlen(hdp->dev_dir)) == 0);
2222 link += strlen(hdp->dev_dir) + 1;
2224 if ((clp = add_link(hdp, link, content, flags)) != NULL) {
2242 /* Skip the "NIL" (index == 0) link. */
2283 nidx = dmp ? dmp->link : DB_HDR(hdp)->dngl_idx;
2316 * It is legal for the link's content and type to be unknown.
2391 * Filter based on link type
2641 /* Allocate new node and link it in */
2695 * Allocate a new minor and link it in either at the tail or head
2783 /* Add to minor's link list */
2785 clp->sib = cmnp->link;
2786 cmnp->link = clp;
3013 for (clp = cmnp->link; clp != NULL; clp = clp->sib) {
3230 s_readlink(const char *link, char *buf, size_t blen)
3234 if ((rv = readlink(link, buf, blen)) == -1)
3247 link, strerror(errno));
3252 * Synchronous link creation interface routines
3622 dprintf(DBG_INFO, "walk_cache_links: initial link: %s\n",
3644 "terminating at link: %s\n", clp->path);
3679 "walk at link: %s\n", clp->path);
3694 (void) walk_cache_links(hdp, cmnp->link, linkp);
3714 if (walk_cache_links(hdp, cmnp->link, linkp)
3735 * expression should use link pathnames relative to