Lines Matching refs:devlink

175 /* /etc/devlink.tab unless devlinks -t used */
185 /* variables for devlink.tab compat processing */
1907 * This function will create any nodes for /etc/devlink.tab.
1908 * If devlink.tab handles link creation, we don't call any
2482 char devlink[PATH_MAX];
2515 (void) strlcpy(devlink, dev_dir, sizeof (devlink));
2516 (void) strlcat(devlink, "/", sizeof (devlink));
2517 (void) strlcat(devlink, link, sizeof (devlink));
2549 vprint(INFO_MID, "adding link %s ==> %s\n", devlink, rcontents);
2552 if ((rv = create_link_common(devlink, rcontents, &link_exists))
2573 (_da_check_for_usb(devlink, root_dir) == 1)) {
2574 (void) da_add_list(&devlist, devlink, instance,
2578 (void) da_add_list(&devlist, devlink, instance,
2597 char devlink[PATH_MAX + 1];
2604 (void) strcpy(devlink, dev_dir);
2605 (void) strcat(devlink, "/");
2606 (void) strcat(devlink, link);
2639 devlink, contents);
2642 if ((rv = create_link_common(devlink, contents, &link_exists))
2663 (void) da_add_list(&devlist, devlink, instance, flags);
2693 create_link_common(char *devlink, char *contents, int *exists)
2707 linksize = readlink(devlink, checkcontents, PATH_MAX);
2712 devlink, checkcontents);
2716 " %s -> %s\n", devlink, contents);
2721 vprint(VERBOSE_MID, CREATING_LINK, devlink, contents);
2741 if (symlink(contents, devlink) == 0) {
2742 vprint(VERBOSE_MID, CREATING_LINK, devlink,
2747 set_logindev_perms(devlink);
2754 hide = strrchr(devlink, '/');
2756 s_mkdirp(devlink, S_IRWXU|S_IRGRP|
2764 err_print(SYMLINK_FAILED, devlink,
2780 linksize = readlink(devlink, checkcontents, PATH_MAX);
2784 s_unlink(devlink);
2786 devlink, checkcontents);
2792 " %s -> %s\n", devlink, contents);
2801 s_unlink(devlink);
2811 err_print(MAX_ATTEMPTS, devlink, contents);
2816 set_logindev_perms(char *devlink)
2842 vprint(FILES_MID, "matching %s with %s\n", devlink,
2845 if (regexec(&newdev->ldev_device_regex, devlink, 0,
2847 vprint(FILES_MID, "matched %s with %s\n", devlink,
2860 (void) resolve_link(devlink, NULL, NULL, &devfs_path, 0);
2881 devlink, pwd_buf);
2891 devlink, drv);
2918 vprint(FILES_MID, "changing permissions of %s\n", devlink);
2952 if (chmod(devlink, newdev->ldev_perms) == -1) {
2953 vprint(VERBOSE_MID, CHMOD_FAILED, devlink,
2958 if (chown(devlink, sb.st_uid, sb.st_gid) == -1) {
2959 vprint(VERBOSE_MID, CHOWN_FAILED, devlink,
3323 * devlink was just created before continuing.
3340 (strcmp(link->devlink, valid_link) != 0)) {
3343 link->devlink, link->contents,
3350 link->devlink);
3408 build_devlink_list(char *devlink, void *data)
3422 vprint(BUILDCACHE_MID, "%scheck_link: %s\n", fcn, devlink);
3424 (void) strcpy(newlink, devlink);
3482 if (strncmp(devlink, dev_dir, strlen(dev_dir)) != 0) {
3483 vprint(BUILDCACHE_MID, "%sinvalid link: %s\n", fcn, devlink);
3487 r_devlink = devlink + strlen(dev_dir);
3498 link->devlink = s_strdup(r_devlink);
3507 * to be consistent, devlink must not begin with / and must be
3512 add_link_to_cache(char *devlink, char *physpath)
3523 devlink, physpath);
3527 if (regexec(&(linkhead->dir_re_compiled), devlink, 0, NULL, 0)
3531 link->devlink = s_strdup(devlink);
3543 * Remove devlink from cache. Devlink must be relative to /dev/ and not start
3547 rm_link_from_cache(char *devlink)
3553 vprint(CACHE_MID, "rm_link_from_cache enter: %s\n", devlink);
3557 if (regexec(&(linkhead->dir_re_compiled), devlink, 0, NULL, 0)
3561 if ((strcmp((*linkp)->devlink, devlink) == 0)) {
3573 free(save->devlink);
3577 "CACHE\n", devlink);
3603 free(link->devlink);
3902 * NOTE: if the devlink database is held open by the caller, it may
4282 * if devlink is in no-further-process hash,
4285 if (nfphash_lookup(link->devlink) != NULL)
4300 link->devlink, link->contents);
4307 "%s", link->devlink);
4472 char devlink[PATH_MAX];
4478 (void) strcpy(devlink, dev_dir);
4479 (void) strcat(devlink, "/");
4480 (void) strcat(devlink, link);
4484 (void) resolve_link(devlink, NULL, NULL, &path, 0);
4497 char devlink[PATH_MAX + 1], *contents, *raw_contents;
4502 (void) strcpy(devlink, dev_dir);
4503 (void) strcat(devlink, "/");
4504 (void) strcat(devlink, link);
4506 if (!device_exists(devlink) || lstat(devlink, &sb) != 0) {
4512 if (resolve_link(devlink, &raw_contents, &type, NULL, 1) == TRUE) {
4532 strstr(devlink, DA_AUDIO_NAME) && contents) {
4534 (void) da_add_list(&devlist, devlink, instance,
6139 * Called at devfsadm startup to read in the devlink.tab file. Creates
6288 * For a single line entry in devlink.tab, split the line into fields
6441 * link is either the second or third field of devlink.tab. Parse link
6442 * into a linked list of devlink structures and return ptr to list. Each
6541 * to build a logical devlink and a possible extra devlink.
6564 /* don't process devlink.tab if devfsadm invoked with -c <class> */
6579 * For a given devlink.tab devlinktab_list entry, see if the selector
6644 * For the given minor node and devlinktab_list entry from devlink.tab,
6645 * build a logical dev link and a possible extra devlink.
6688 * The counter rule for devlink.tab entries is implemented via
6691 * For devlink.tab entries, this path regular expression is derived from
6692 * the devlink spec. get_anchored_re() accepts path regular expressions derived
6693 * from devlink.tab entries and inserts the anchors '^' and '$' at the beginning
8680 vprint(RSBY_MID, "devlink(%s) matches RE(%s). "
8703 vprint(RSBY_MID, "devlink: %s\n", entry->er_file);
8735 * we assume that the devlink is *not* reserved
8738 devfsadm_is_reserved(devlink_re_t re_array[], char *devlink)
8745 estruct.er_file = devlink;
8750 err_print("devfsadm_is_reserved: devlink (%s) does not "
8751 "match RE\n", devlink);
8755 err_print("devfsadm_is_reserved: ID derived from devlink %s "
8756 "is NULL\n", devlink);
8767 vprint(RSBY_MID, "reserve file entry (%s) and devlink (%s) "
8768 "match\n", entry->er_file, devlink);