|
|
821f82 |
From ba0655c62978ba64c227f1f87d9da3e1dea4f821 Mon Sep 17 00:00:00 2001
|
|
|
821f82 |
From: Peter Jones <pjones@redhat.com>
|
|
|
821f82 |
Date: Wed, 20 Jun 2018 14:37:14 -0400
|
|
|
821f82 |
Subject: [PATCH 12/17] Give linux-*'s ->parse() functions the unmodified
|
|
|
821f82 |
device link as well
|
|
|
821f82 |
|
|
|
821f82 |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
821f82 |
---
|
|
|
821f82 |
src/linux-ata.c | 2 +-
|
|
|
821f82 |
src/linux-i2o.c | 2 +-
|
|
|
821f82 |
src/linux-nvme.c | 2 +-
|
|
|
821f82 |
src/linux-pci.c | 2 +-
|
|
|
821f82 |
src/linux-pmem.c | 2 +-
|
|
|
821f82 |
src/linux-sas.c | 2 +-
|
|
|
821f82 |
src/linux-sata.c | 2 +-
|
|
|
821f82 |
src/linux-scsi.c | 2 +-
|
|
|
821f82 |
src/linux-virtblk.c | 2 +-
|
|
|
821f82 |
src/linux.c | 4 ++--
|
|
|
821f82 |
src/linux.h | 3 ++-
|
|
|
821f82 |
11 files changed, 13 insertions(+), 12 deletions(-)
|
|
|
821f82 |
|
|
|
821f82 |
diff --git a/src/linux-ata.c b/src/linux-ata.c
|
|
|
821f82 |
index 6a47ff3f279..dab02f3d224 100644
|
|
|
821f82 |
--- a/src/linux-ata.c
|
|
|
821f82 |
+++ b/src/linux-ata.c
|
|
|
821f82 |
@@ -58,7 +58,7 @@ is_pata(struct device *dev)
|
|
|
821f82 |
* 11:0 -> ../../devices/pci0000:00/0000:00:11.5/ata3/host2/target2:0:0/2:0:0:0/block/sr0
|
|
|
821f82 |
*/
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_ata(struct device *dev, const char *current)
|
|
|
821f82 |
+parse_ata(struct device *dev, const char *current, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
uint32_t scsi_host, scsi_bus, scsi_device, scsi_target;
|
|
|
821f82 |
uint64_t scsi_lun;
|
|
|
821f82 |
diff --git a/src/linux-i2o.c b/src/linux-i2o.c
|
|
|
821f82 |
index e57c0cb344f..4fe79e5719f 100644
|
|
|
821f82 |
--- a/src/linux-i2o.c
|
|
|
821f82 |
+++ b/src/linux-i2o.c
|
|
|
821f82 |
@@ -33,7 +33,7 @@
|
|
|
821f82 |
* ... probably doesn't work.
|
|
|
821f82 |
*/
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_i2o(struct device *dev, const char *current UNUSED)
|
|
|
821f82 |
+parse_i2o(struct device *dev, const char *current UNUSED, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
debug(DEBUG, "entry");
|
|
|
821f82 |
/* I2O disks can have up to 16 partitions, or 4 bits worth. */
|
|
|
821f82 |
diff --git a/src/linux-nvme.c b/src/linux-nvme.c
|
|
|
821f82 |
index 6d5196fc082..00f53d5a9a7 100644
|
|
|
821f82 |
--- a/src/linux-nvme.c
|
|
|
821f82 |
+++ b/src/linux-nvme.c
|
|
|
821f82 |
@@ -48,7 +48,7 @@
|
|
|
821f82 |
*/
|
|
|
821f82 |
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_nvme(struct device *dev, const char *current)
|
|
|
821f82 |
+parse_nvme(struct device *dev, const char *current, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
int rc;
|
|
|
821f82 |
int32_t tosser0, tosser1, tosser2, ctrl_id, ns_id, partition;
|
|
|
821f82 |
diff --git a/src/linux-pci.c b/src/linux-pci.c
|
|
|
821f82 |
index 0d2a90ab166..4fbd108e3ed 100644
|
|
|
821f82 |
--- a/src/linux-pci.c
|
|
|
821f82 |
+++ b/src/linux-pci.c
|
|
|
821f82 |
@@ -41,7 +41,7 @@
|
|
|
821f82 |
*
|
|
|
821f82 |
*/
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_pci(struct device *dev, const char *current)
|
|
|
821f82 |
+parse_pci(struct device *dev, const char *current, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
int rc;
|
|
|
821f82 |
int pos;
|
|
|
821f82 |
diff --git a/src/linux-pmem.c b/src/linux-pmem.c
|
|
|
821f82 |
index 045650bc471..9a075716f7f 100644
|
|
|
821f82 |
--- a/src/linux-pmem.c
|
|
|
821f82 |
+++ b/src/linux-pmem.c
|
|
|
821f82 |
@@ -70,7 +70,7 @@
|
|
|
821f82 |
*/
|
|
|
821f82 |
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_pmem(struct device *dev, const char *current)
|
|
|
821f82 |
+parse_pmem(struct device *dev, const char *current, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
uint8_t *filebuf = NULL;
|
|
|
821f82 |
uint8_t system, sysbus, acpi_id;
|
|
|
821f82 |
diff --git a/src/linux-sas.c b/src/linux-sas.c
|
|
|
821f82 |
index 4a11147aef1..5f44f2c1f7b 100644
|
|
|
821f82 |
--- a/src/linux-sas.c
|
|
|
821f82 |
+++ b/src/linux-sas.c
|
|
|
821f82 |
@@ -45,7 +45,7 @@
|
|
|
821f82 |
* I'm not sure at the moment if they're the same or not.
|
|
|
821f82 |
*/
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_sas(struct device *dev, const char *current)
|
|
|
821f82 |
+parse_sas(struct device *dev, const char *current, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
struct stat statbuf = { 0, };
|
|
|
821f82 |
int rc;
|
|
|
821f82 |
diff --git a/src/linux-sata.c b/src/linux-sata.c
|
|
|
821f82 |
index a670ad9907e..d9a62efdbe6 100644
|
|
|
821f82 |
--- a/src/linux-sata.c
|
|
|
821f82 |
+++ b/src/linux-sata.c
|
|
|
821f82 |
@@ -138,7 +138,7 @@ sysfs_sata_get_port_info(uint32_t print_id, struct device *dev)
|
|
|
821f82 |
}
|
|
|
821f82 |
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_sata(struct device *dev, const char *devlink)
|
|
|
821f82 |
+parse_sata(struct device *dev, const char *devlink, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
const char *current = devlink;
|
|
|
821f82 |
uint32_t print_id;
|
|
|
821f82 |
diff --git a/src/linux-scsi.c b/src/linux-scsi.c
|
|
|
821f82 |
index 87f2f7f7c92..153a4ff87ad 100644
|
|
|
821f82 |
--- a/src/linux-scsi.c
|
|
|
821f82 |
+++ b/src/linux-scsi.c
|
|
|
821f82 |
@@ -160,7 +160,7 @@ parse_scsi_link(const char *current, uint32_t *scsi_host,
|
|
|
821f82 |
}
|
|
|
821f82 |
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_scsi(struct device *dev, const char *current)
|
|
|
821f82 |
+parse_scsi(struct device *dev, const char *current, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
uint32_t scsi_host, scsi_bus, scsi_device, scsi_target;
|
|
|
821f82 |
uint64_t scsi_lun;
|
|
|
821f82 |
diff --git a/src/linux-virtblk.c b/src/linux-virtblk.c
|
|
|
821f82 |
index 6dedf0f27ee..9ee7994aeb3 100644
|
|
|
821f82 |
--- a/src/linux-virtblk.c
|
|
|
821f82 |
+++ b/src/linux-virtblk.c
|
|
|
821f82 |
@@ -45,7 +45,7 @@
|
|
|
821f82 |
* But usually we just write the HD() entry, of course.
|
|
|
821f82 |
*/
|
|
|
821f82 |
static ssize_t
|
|
|
821f82 |
-parse_virtblk(struct device *dev, const char *current)
|
|
|
821f82 |
+parse_virtblk(struct device *dev, const char *current, const char *root UNUSED)
|
|
|
821f82 |
{
|
|
|
821f82 |
uint32_t tosser;
|
|
|
821f82 |
int pos;
|
|
|
821f82 |
diff --git a/src/linux.c b/src/linux.c
|
|
|
821f82 |
index fe45c6004b9..ef560753481 100644
|
|
|
821f82 |
--- a/src/linux.c
|
|
|
821f82 |
+++ b/src/linux.c
|
|
|
821f82 |
@@ -352,7 +352,7 @@ struct device HIDDEN
|
|
|
821f82 |
efi_error("strdup(\"%s\") failed", linkbuf);
|
|
|
821f82 |
goto err;
|
|
|
821f82 |
}
|
|
|
821f82 |
- debug(DEBUG, "dev->link: %s\n", dev->link);
|
|
|
821f82 |
+ debug(DEBUG, "dev->link: %s", dev->link);
|
|
|
821f82 |
|
|
|
821f82 |
if (dev->part == -1) {
|
|
|
821f82 |
rc = read_sysfs_file(&tmpbuf, "dev/block/%s/partition", dev->link);
|
|
|
821f82 |
@@ -431,7 +431,7 @@ struct device HIDDEN
|
|
|
821f82 |
}
|
|
|
821f82 |
|
|
|
821f82 |
debug(DEBUG, "trying %s", probe->name);
|
|
|
821f82 |
- pos = probe->parse(dev, current);
|
|
|
821f82 |
+ pos = probe->parse(dev, current, dev->link);
|
|
|
821f82 |
if (pos < 0) {
|
|
|
821f82 |
efi_error("parsing %s failed", probe->name);
|
|
|
821f82 |
goto err;
|
|
|
821f82 |
diff --git a/src/linux.h b/src/linux.h
|
|
|
821f82 |
index 39826224a53..35951bb4d16 100644
|
|
|
821f82 |
--- a/src/linux.h
|
|
|
821f82 |
+++ b/src/linux.h
|
|
|
821f82 |
@@ -244,7 +244,8 @@ struct dev_probe {
|
|
|
821f82 |
char *name;
|
|
|
821f82 |
enum interface_type *iftypes;
|
|
|
821f82 |
uint32_t flags;
|
|
|
821f82 |
- ssize_t (*parse)(struct device *dev, const char * const current);
|
|
|
821f82 |
+ ssize_t (*parse)(struct device *dev,
|
|
|
821f82 |
+ const char * const current, const char * const root);
|
|
|
821f82 |
ssize_t (*create)(struct device *dev,
|
|
|
821f82 |
uint8_t *buf, ssize_t size, ssize_t off);
|
|
|
821f82 |
char *(*make_part_name)(struct device *dev);
|
|
|
821f82 |
--
|
|
|
821f82 |
2.17.1
|
|
|
821f82 |
|