OSDN Git Service

Give linux-*'s ->parse() functions the unmodified device link as well
authorPeter Jones <pjones@redhat.com>
Wed, 20 Jun 2018 18:37:14 +0000 (14:37 -0400)
committerPeter Jones <pjones@redhat.com>
Wed, 20 Jun 2018 21:23:22 +0000 (17:23 -0400)
Signed-off-by: Peter Jones <pjones@redhat.com>
src/linux-ata.c
src/linux-i2o.c
src/linux-nvme.c
src/linux-pci.c
src/linux-pmem.c
src/linux-sas.c
src/linux-sata.c
src/linux-scsi.c
src/linux-virtblk.c
src/linux.c
src/linux.h

index 6a47ff3..dab02f3 100644 (file)
@@ -58,7 +58,7 @@ is_pata(struct device *dev)
  * 11:0 -> ../../devices/pci0000:00/0000:00:11.5/ata3/host2/target2:0:0/2:0:0:0/block/sr0
  */
 static ssize_t
-parse_ata(struct device *dev, const char *current)
+parse_ata(struct device *dev, const char *current, const char *root UNUSED)
 {
         uint32_t scsi_host, scsi_bus, scsi_device, scsi_target;
         uint64_t scsi_lun;
index e57c0cb..4fe79e5 100644 (file)
@@ -33,7 +33,7 @@
  * ... probably doesn't work.
  */
 static ssize_t
-parse_i2o(struct device *dev, const char *current UNUSED)
+parse_i2o(struct device *dev, const char *current UNUSED, const char *root UNUSED)
 {
         debug(DEBUG, "entry");
         /* I2O disks can have up to 16 partitions, or 4 bits worth. */
index 6d5196f..00f53d5 100644 (file)
@@ -48,7 +48,7 @@
  */
 
 static ssize_t
-parse_nvme(struct device *dev, const char *current)
+parse_nvme(struct device *dev, const char *current, const char *root UNUSED)
 {
         int rc;
         int32_t tosser0, tosser1, tosser2, ctrl_id, ns_id, partition;
index 0d2a90a..4fbd108 100644 (file)
@@ -41,7 +41,7 @@
  *
  */
 static ssize_t
-parse_pci(struct device *dev, const char *current)
+parse_pci(struct device *dev, const char *current, const char *root UNUSED)
 {
         int rc;
         int pos;
index 045650b..9a07571 100644 (file)
@@ -70,7 +70,7 @@
  */
 
 static ssize_t
-parse_pmem(struct device *dev, const char *current)
+parse_pmem(struct device *dev, const char *current, const char *root UNUSED)
 {
         uint8_t *filebuf = NULL;
         uint8_t system, sysbus, acpi_id;
index 4a11147..5f44f2c 100644 (file)
@@ -45,7 +45,7 @@
  * I'm not sure at the moment if they're the same or not.
  */
 static ssize_t
-parse_sas(struct device *dev, const char *current)
+parse_sas(struct device *dev, const char *current, const char *root UNUSED)
 {
         struct stat statbuf = { 0, };
         int rc;
index a670ad9..d9a62ef 100644 (file)
@@ -138,7 +138,7 @@ sysfs_sata_get_port_info(uint32_t print_id, struct device *dev)
 }
 
 static ssize_t
-parse_sata(struct device *dev, const char *devlink)
+parse_sata(struct device *dev, const char *devlink, const char *root UNUSED)
 {
         const char *current = devlink;
         uint32_t print_id;
index 87f2f7f..153a4ff 100644 (file)
@@ -160,7 +160,7 @@ parse_scsi_link(const char *current, uint32_t *scsi_host,
 }
 
 static ssize_t
-parse_scsi(struct device *dev, const char *current)
+parse_scsi(struct device *dev, const char *current, const char *root UNUSED)
 {
         uint32_t scsi_host, scsi_bus, scsi_device, scsi_target;
         uint64_t scsi_lun;
index 6dedf0f..9ee7994 100644 (file)
@@ -45,7 +45,7 @@
  * But usually we just write the HD() entry, of course.
  */
 static ssize_t
-parse_virtblk(struct device *dev, const char *current)
+parse_virtblk(struct device *dev, const char *current, const char *root UNUSED)
 {
         uint32_t tosser;
         int pos;
index fe45c60..ef56075 100644 (file)
@@ -352,7 +352,7 @@ struct device HIDDEN
                 efi_error("strdup(\"%s\") failed", linkbuf);
                 goto err;
         }
-        debug(DEBUG, "dev->link: %s\n", dev->link);
+        debug(DEBUG, "dev->link: %s", dev->link);
 
         if (dev->part == -1) {
                 rc = read_sysfs_file(&tmpbuf, "dev/block/%s/partition", dev->link);
@@ -431,7 +431,7 @@ struct device HIDDEN
                 }
 
                 debug(DEBUG, "trying %s", probe->name);
-                pos = probe->parse(dev, current);
+                pos = probe->parse(dev, current, dev->link);
                 if (pos < 0) {
                         efi_error("parsing %s failed", probe->name);
                         goto err;
index 3982622..35951bb 100644 (file)
@@ -244,7 +244,8 @@ struct dev_probe {
         char *name;
         enum interface_type *iftypes;
         uint32_t flags;
-        ssize_t (*parse)(struct device *dev, const char * const current);
+        ssize_t (*parse)(struct device *dev,
+                         const char * const current, const char * const root);
         ssize_t (*create)(struct device *dev,
                           uint8_t *buf, ssize_t size, ssize_t off);
         char *(*make_part_name)(struct device *dev);