Lines Matching defs:link

131 /* pointers to create/remove link lists */
181 /* set if /dev link is new. speeds up rm_stale_links */
213 /* Globals used by the link database */
1208 * link creation.
1767 * Restrict hotplug link creation if daemon
1907 * If devlink.tab handles link creation, we don't call any
1924 * look for relevant link create rules in the modules, and
1925 * invoke the link create callback function to build a link
2004 * Check to see if "create" link creation rule matches this node/minor.
2129 * Load devfsadm logical link processing modules.
2473 * Creates a symlink 'link' to the physical path of node:minor.
2474 * Construct link contents, then call create_link_common().
2478 devfsadm_mklink(char *link, di_node_t node, di_minor_t minor, int flags)
2513 /* prepend link with dev_dir contents */
2516 (void) strlcat(devlink, link, sizeof (devlink));
2522 for (i = 0; link[i] == '/'; i++)
2524 for (numslashes = 0; link[i] != '\0'; i++) {
2525 if (link[i] == '/') {
2535 if (link[i-1] == '/') {
2548 vprint(INFO_MID, "adding link %s ==> %s\n", devlink, rcontents);
2554 add_link_to_cache(link, acontents);
2561 (void) di_devlink_add_link(devlink_cache, link, rcontents,
2588 * Creates a symlink link to primary_link. Calculates relative
2593 devfsadm_secondary_link(char *link, char *primary_link, int flags)
2602 /* prepend link with dev_dir contents */
2605 (void) strcat(devlink, link);
2607 * building extra link, so use first link as link contents, but first
2610 fpath = link;
2637 vprint(INFO_MID, "adding extra link %s ==> %s\n",
2645 * secondary link, since hotcleanup only looks at /devices path.
2647 * by readlink'ing the secondary link. This assumes the primary
2648 * link was created first.
2650 add_link_to_cache(link, lphy_path);
2670 * If link exists or was just created, add it to the database
2673 (void) di_devlink_add_link(devlink_cache, link, contents,
2688 * Does the actual link creation. VERBOSE_MID only used if there is
2705 /* we want *actual* link contents so no alias redirection */
2714 vprint(CHATTY_MID, "link exists and is correct:"
2716 /* failure only in that the link existed */
2744 /* link successfully created */
2775 * link will be created with new phys path
2790 "link exists and is correct:"
2793 /* failure in that the link existed */
2861 * We dont need redirection here - the actual link contents
2879 vprint(FILES_MID, "link=%s->physpath=%s\n",
3108 * Removes logical link and the minor node it refers to. If file is a
3109 * link, we recurse and try to remove the minor node (or link if path is
3110 * a double link) that file's link contents refer to.
3146 * recurse if link points to another link
3268 * its logical link will change, while the physical node remains the same.
3270 * in /devices, the valid link and a stale link. This function will
3284 * any link whose contents match "valid_link_contents" with a corresponding link
3294 link_t *link;
3333 for (link = head->link; link != NULL; link = head->nextlink) {
3337 head->nextlink = link->next;
3338 if ((strcmp(link->contents, valid_link_contents) == 0) &&
3339 (strcmp(link->devlink, valid_link) != 0)) {
3341 "valid link is: %s -> %s\n",
3342 link->devlink, link->contents,
3345 * Use a copy of the cached link name as the
3346 * cache entry will go away during link removal
3349 link->devlink);
3389 linkhead->link = NULL;
3418 link_t *link;
3435 * Suppress error messages in those cases or if the link
3448 * assume that link contents is really a pointer to
3449 * another link, so recurse and read its link contents.
3451 * some link contents are absolute:
3459 "link. missing '/'\n", fcn,
3482 vprint(BUILDCACHE_MID, "%sinvalid link: %s\n", fcn, devlink);
3491 link = s_malloc(sizeof (link_t));
3496 vprint(BUILDCACHE_MID, "%scaching link: %s\n", fcn, r_devlink);
3497 link->devlink = s_strdup(r_devlink);
3499 link->contents = s_strdup(r_contents);
3501 link->next = linkhead->link;
3502 linkhead->link = link;
3514 link_t *link;
3529 link = s_malloc(sizeof (link_t));
3530 link->devlink = s_strdup(devlink);
3531 link->contents = s_strdup(physpath);
3532 link->next = linkhead->link;
3533 linkhead->link = link;
3559 for (linkp = &(linkhead->link); *linkp != NULL; ) {
3565 * "next" link. Update the nextlink
3568 * link
3590 link_t *link;
3600 for (link = linkhead->link; link != NULL; link = nextlink) {
3601 nextlink = link->next;
3602 free(link->devlink);
3603 free(link->contents);
3604 free(link);
4232 link_t *link;
4266 for (link = head->link;
4267 link != NULL; link = head->nextlink) {
4272 * Save the next link in the head. If
4273 * the callback removes the next link
4276 * the next valid link.
4278 head->nextlink = link->next;
4284 if (nfphash_lookup(link->devlink) != NULL)
4288 skip = strcmp(link->contents, path);
4290 skip = strncmp(link->contents, path,
4299 link->devlink, link->contents);
4301 * Use a copy of the cached link name
4303 * during link removal
4306 "%s", link->devlink);
4432 * If the link is in the no-further-process hash
4460 * this link. Add it to the nfp_hash;
4469 devfsadm_read_link(di_node_t anynode, char *link, char **devfs_path)
4476 /* prepend link with dev_dir contents */
4479 (void) strcat(devlink, link);
4493 devfsadm_link_valid(di_node_t anynode, char *link)
4500 /* prepend link with dev_dir contents */
4503 (void) strcat(devlink, link);
4527 * The link exists. Add it to the database
4529 (void) di_devlink_add_link(devlink_cache, link, contents, type);
4543 * devpath: Absolute path to /dev link
4544 * content_p: Returns malloced string (link content)
4545 * type_p: Returns link type: primary or secondary
4547 * dangle: if set, check if link is dangling
4584 * Check to see if this is a link pointing to another link in /dev. The
4596 * link, and if so recurse and read its link contents.
4605 vprint(REMOVE_MID, "%s%s -> %s invalid link. "
4619 /* Current link points at a /devices minor node */
4959 /* should never create a link with a reserved ID */
5198 * by the new link bypass code in disks
5228 * link, and then stat and return it. This is valid for the same reason
5250 * If it is a dir, recurse down until we find a link and
5251 * then use the link.
5694 vprint(RSRV_MID, "ID derived from /dev link is"
5697 vprint(RSRV_MID, "ID derived from /dev link is"
5708 * If path is a dir, it is changed to the first symbolic link it find
5734 * linkbuf if it is a link.
5805 * the link or special file already exists on <root>, skip the copy. (it
6440 * link is either the second or third field of devlink.tab. Parse link
6447 create_link_list(char *link)
6458 if (link == NULL) {
6462 while ((*link != '\0') && (error == FALSE)) {
6466 while ((*link != '\0') && (*link != '\\')) {
6468 constant[x++] = *(link++);
6477 switch (*(++link)) {
6504 if (*(link++) != 'D') {
6505 if (isdigit(*link) == FALSE) {
6512 (int)strtoul(link, &link, 10);
6644 * build a logical dev link and a possible extra devlink.
6645 * Return DEVFSADM_SUCCESS if link is created, otherwise DEVFSADM_FAILURE.
6698 get_anchored_re(char *link, char *anchored_re, char *pattern)
6700 if (*link == '/' || *link == '\0') {
6706 for (; *link != '\0'; ) {
6707 if (*link == '/') {
6708 while (*link == '/')
6709 link++;
6712 if (*link != '\0') {
6716 *anchored_re++ = *link++;
6717 if (*link == '\0') {
6728 construct_devlink(char *link, link_list_t *link_build, char *contents,
6739 link[0] = '\0';
6744 (void) strcat(link, di_node_name(node));
6747 (void) strcat(link, link_build->constant);
6750 if (component_cat(link, di_bus_addr(node),
6760 if (component_cat(link, di_minor_name(minor),
6770 counter_offset = strlen(link);
6771 (void) strcat(link, "([0-9]+)");
6786 &link[counter_offset + strlen("([0-9]+)")]);
6787 if (get_anchored_re(link, anchored_re, pattern)
6798 (void) strcpy(&link[counter_offset], buff);
6800 (void) strcat(link, templink);
6801 vprint(DEVLINK_MID, "COUNTER is %s\n", link);
6843 * strcat() field # "field" of comma separated list "name" to "link".
6848 component_cat(char *link, char *name, int field)
6856 (void) strcat(link, name);
6860 while (*link != '\0') {
6861 link++;
6876 *(link++) = *(name++);
6879 *link = '\0';