Lines Matching defs:link

132 /* pointers to create/remove link lists */
182 /* set if /dev link is new. speeds up rm_stale_links */
214 /* Globals used by the link database */
1209 * link creation.
1768 * Restrict hotplug link creation if daemon
1908 * If devlink.tab handles link creation, we don't call any
1925 * look for relevant link create rules in the modules, and
1926 * invoke the link create callback function to build a link
2005 * Check to see if "create" link creation rule matches this node/minor.
2130 * Load devfsadm logical link processing modules.
2474 * Creates a symlink 'link' to the physical path of node:minor.
2475 * Construct link contents, then call create_link_common().
2479 devfsadm_mklink(char *link, di_node_t node, di_minor_t minor, int flags)
2514 /* prepend link with dev_dir contents */
2517 (void) strlcat(devlink, link, sizeof (devlink));
2523 for (i = 0; link[i] == '/'; i++)
2525 for (numslashes = 0; link[i] != '\0'; i++) {
2526 if (link[i] == '/') {
2536 if (link[i-1] == '/') {
2549 vprint(INFO_MID, "adding link %s ==> %s\n", devlink, rcontents);
2555 add_link_to_cache(link, acontents);
2562 (void) di_devlink_add_link(devlink_cache, link, rcontents,
2589 * Creates a symlink link to primary_link. Calculates relative
2594 devfsadm_secondary_link(char *link, char *primary_link, int flags)
2603 /* prepend link with dev_dir contents */
2606 (void) strcat(devlink, link);
2608 * building extra link, so use first link as link contents, but first
2611 fpath = link;
2638 vprint(INFO_MID, "adding extra link %s ==> %s\n",
2646 * secondary link, since hotcleanup only looks at /devices path.
2648 * by readlink'ing the secondary link. This assumes the primary
2649 * link was created first.
2651 add_link_to_cache(link, lphy_path);
2671 * If link exists or was just created, add it to the database
2674 (void) di_devlink_add_link(devlink_cache, link, contents,
2689 * Does the actual link creation. VERBOSE_MID only used if there is
2706 /* we want *actual* link contents so no alias redirection */
2715 vprint(CHATTY_MID, "link exists and is correct:"
2717 /* failure only in that the link existed */
2745 /* link successfully created */
2776 * link will be created with new phys path
2791 "link exists and is correct:"
2794 /* failure in that the link existed */
2862 * We dont need redirection here - the actual link contents
2880 vprint(FILES_MID, "link=%s->physpath=%s\n",
3109 * Removes logical link and the minor node it refers to. If file is a
3110 * link, we recurse and try to remove the minor node (or link if path is
3111 * a double link) that file's link contents refer to.
3147 * recurse if link points to another link
3269 * its logical link will change, while the physical node remains the same.
3271 * in /devices, the valid link and a stale link. This function will
3285 * any link whose contents match "valid_link_contents" with a corresponding link
3295 link_t *link;
3334 for (link = head->link; link != NULL; link = head->nextlink) {
3338 head->nextlink = link->next;
3339 if ((strcmp(link->contents, valid_link_contents) == 0) &&
3340 (strcmp(link->devlink, valid_link) != 0)) {
3342 "valid link is: %s -> %s\n",
3343 link->devlink, link->contents,
3346 * Use a copy of the cached link name as the
3347 * cache entry will go away during link removal
3350 link->devlink);
3390 linkhead->link = NULL;
3419 link_t *link;
3436 * Suppress error messages in those cases or if the link
3449 * assume that link contents is really a pointer to
3450 * another link, so recurse and read its link contents.
3452 * some link contents are absolute:
3460 "link. missing '/'\n", fcn,
3483 vprint(BUILDCACHE_MID, "%sinvalid link: %s\n", fcn, devlink);
3492 link = s_malloc(sizeof (link_t));
3497 vprint(BUILDCACHE_MID, "%scaching link: %s\n", fcn, r_devlink);
3498 link->devlink = s_strdup(r_devlink);
3500 link->contents = s_strdup(r_contents);
3502 link->next = linkhead->link;
3503 linkhead->link = link;
3515 link_t *link;
3530 link = s_malloc(sizeof (link_t));
3531 link->devlink = s_strdup(devlink);
3532 link->contents = s_strdup(physpath);
3533 link->next = linkhead->link;
3534 linkhead->link = link;
3560 for (linkp = &(linkhead->link); *linkp != NULL; ) {
3566 * "next" link. Update the nextlink
3569 * link
3591 link_t *link;
3601 for (link = linkhead->link; link != NULL; link = nextlink) {
3602 nextlink = link->next;
3603 free(link->devlink);
3604 free(link->contents);
3605 free(link);
4233 link_t *link;
4267 for (link = head->link;
4268 link != NULL; link = head->nextlink) {
4273 * Save the next link in the head. If
4274 * the callback removes the next link
4277 * the next valid link.
4279 head->nextlink = link->next;
4285 if (nfphash_lookup(link->devlink) != NULL)
4289 skip = strcmp(link->contents, path);
4291 skip = strncmp(link->contents, path,
4300 link->devlink, link->contents);
4302 * Use a copy of the cached link name
4304 * during link removal
4307 "%s", link->devlink);
4433 * If the link is in the no-further-process hash
4461 * this link. Add it to the nfp_hash;
4470 devfsadm_read_link(di_node_t anynode, char *link, char **devfs_path)
4477 /* prepend link with dev_dir contents */
4480 (void) strcat(devlink, link);
4494 devfsadm_link_valid(di_node_t anynode, char *link)
4501 /* prepend link with dev_dir contents */
4504 (void) strcat(devlink, link);
4528 * The link exists. Add it to the database
4530 (void) di_devlink_add_link(devlink_cache, link, contents, type);
4544 * devpath: Absolute path to /dev link
4545 * content_p: Returns malloced string (link content)
4546 * type_p: Returns link type: primary or secondary
4548 * dangle: if set, check if link is dangling
4585 * Check to see if this is a link pointing to another link in /dev. The
4597 * link, and if so recurse and read its link contents.
4606 vprint(REMOVE_MID, "%s%s -> %s invalid link. "
4620 /* Current link points at a /devices minor node */
4960 /* should never create a link with a reserved ID */
5199 * by the new link bypass code in disks
5229 * link, and then stat and return it. This is valid for the same reason
5251 * If it is a dir, recurse down until we find a link and
5252 * then use the link.
5695 vprint(RSRV_MID, "ID derived from /dev link is"
5698 vprint(RSRV_MID, "ID derived from /dev link is"
5709 * If path is a dir, it is changed to the first symbolic link it find
5735 * linkbuf if it is a link.
5806 * the link or special file already exists on <root>, skip the copy. (it
6441 * link is either the second or third field of devlink.tab. Parse link
6448 create_link_list(char *link)
6459 if (link == NULL) {
6463 while ((*link != '\0') && (error == FALSE)) {
6467 while ((*link != '\0') && (*link != '\\')) {
6469 constant[x++] = *(link++);
6478 switch (*(++link)) {
6505 if (*(link++) != 'D') {
6506 if (isdigit(*link) == FALSE) {
6513 (int)strtoul(link, &link, 10);
6645 * build a logical dev link and a possible extra devlink.
6646 * Return DEVFSADM_SUCCESS if link is created, otherwise DEVFSADM_FAILURE.
6699 get_anchored_re(char *link, char *anchored_re, char *pattern)
6701 if (*link == '/' || *link == '\0') {
6707 for (; *link != '\0'; ) {
6708 if (*link == '/') {
6709 while (*link == '/')
6710 link++;
6713 if (*link != '\0') {
6717 *anchored_re++ = *link++;
6718 if (*link == '\0') {
6729 construct_devlink(char *link, link_list_t *link_build, char *contents,
6740 link[0] = '\0';
6745 (void) strcat(link, di_node_name(node));
6748 (void) strcat(link, link_build->constant);
6751 if (component_cat(link, di_bus_addr(node),
6761 if (component_cat(link, di_minor_name(minor),
6771 counter_offset = strlen(link);
6772 (void) strcat(link, "([0-9]+)");
6787 &link[counter_offset + strlen("([0-9]+)")]);
6788 if (get_anchored_re(link, anchored_re, pattern)
6799 (void) strcpy(&link[counter_offset], buff);
6801 (void) strcat(link, templink);
6802 vprint(DEVLINK_MID, "COUNTER is %s\n", link);
6844 * strcat() field # "field" of comma separated list "name" to "link".
6849 component_cat(char *link, char *name, int field)
6857 (void) strcat(link, name);
6861 while (*link != '\0') {
6862 link++;
6877 *(link++) = *(name++);
6880 *link = '\0';