Lines Matching refs:path

2  * compose persistent device path
36 static int path_prepend(char **path, const char *fmt, ...) {
47 if (*path != NULL) {
50 err = asprintf(&new, "%s-%s", pre, *path);
54 free(*path);
55 *path = new;
57 *path = pre;
67 static int format_lun_number(struct udev_device *dev, char **path) {
72 return path_prepend(path, "lun-%lu", lun);
74 return path_prepend(path, "lun-0x%04lx%04lx00000000", lun & 0xffff, (lun >> 16) & 0xffff);
92 static struct udev_device *handle_scsi_fibre_channel(struct udev_device *parent, char **path) {
113 path_prepend(path, "fc-%s-%s", port, lun);
121 static struct udev_device *handle_scsi_sas_wide_port(struct udev_device *parent, char **path) {
149 path_prepend(path, "sas-%s-%s", sas_address, lun);
157 static struct udev_device *handle_scsi_sas(struct udev_device *parent, char **path)
205 parent = handle_scsi_sas_wide_port(parent, path);
238 path_prepend(path, "sas-exp%s-phy%s-%s", sas_address, phy_id, lun);
240 path_prepend(path, "sas-phy%s-%s", phy_id, lun);
251 static struct udev_device *handle_scsi_iscsi(struct udev_device *parent, char **path) {
300 path_prepend(path, "ip-%s:%s-iscsi-%s-%s", addr, port, target, lun);
309 static struct udev_device *handle_scsi_default(struct udev_device *parent, char **path) {
387 path_prepend(path, "scsi-%u:%u:%u:%u", host, bus, target, lun);
393 static struct udev_device *handle_scsi_hyperv(struct udev_device *parent, char **path) {
424 path_prepend(path, "vmbus-%s-%s", guid, lun);
429 static struct udev_device *handle_scsi(struct udev_device *parent, char **path, bool *supported_parent) {
442 path_prepend(path, "ieee1394-0x%s", id);
451 parent = handle_scsi_fibre_channel(parent, path);
457 parent = handle_scsi_sas(parent, path);
463 parent = handle_scsi_iscsi(parent, path);
476 * Until all that is solved at the kernel level, there are no by-path/
485 parent = handle_scsi_hyperv(parent, path);
489 parent = handle_scsi_default(parent, path);
494 static struct udev_device *handle_cciss(struct udev_device *parent, char **path) {
502 path_prepend(path, "cciss-disk%u", disk);
507 static void handle_scsi_tape(struct udev_device *dev, char **path) {
511 if (*path != NULL)
516 path_prepend(path, "nst%c", name[3]);
518 path_prepend(path, "st%c", name[2]);
521 static struct udev_device *handle_usb(struct udev_device *parent, char **path) {
539 path_prepend(path, "usb-0:%s", port);
543 static struct udev_device *handle_bcma(struct udev_device *parent, char **path) {
551 path_prepend(path, "bcma-%u", core);
555 static struct udev_device *handle_ccw(struct udev_device *parent, struct udev_device *dev, char **path) {
568 path_prepend(path, "ccw-%s-zfcp-%s:%s", hba_id, wwpn, lun);
573 path_prepend(path, "ccw-%s", udev_device_get_sysname(parent));
581 char *path = NULL;
588 handle_ccw(parent, dev, &path);
592 /* walk up the chain of devices and compose path */
601 handle_scsi_tape(parent, &path);
603 parent = handle_scsi(parent, &path, &supported_parent);
606 parent = handle_cciss(parent, &path);
609 parent = handle_usb(parent, &path);
612 parent = handle_bcma(parent, &path);
615 path_prepend(&path, "serio-%s", udev_device_get_sysnum(parent));
618 path_prepend(&path, "pci-%s", udev_device_get_sysname(parent));
622 path_prepend(&path, "platform-%s", udev_device_get_sysname(parent));
627 path_prepend(&path, "acpi-%s", udev_device_get_sysname(parent));
631 path_prepend(&path, "xen-%s", udev_device_get_sysname(parent));
635 path_prepend(&path, "scm-%s", udev_device_get_sysname(parent));
650 free(path);
651 path = NULL;
660 free(path);
661 path = NULL;
665 if (path != NULL) {
671 for (p = path, i = 0; *p; p++) {
695 udev_builtin_add_property(dev, test, "ID_PATH", path);
697 free(path);
706 .help = "Compose persistent device path",