From cbfb5a98b5dbe699aaafbced00120f60aaa35231 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Mon, 11 Mar 2013 20:10:49 +0000 Subject: [PATCH] filters: power2 devs get precedence if PVIDs match Give precedence to EMC "power2" devices with duplicate PVIDs like we already do with "emcpower" devices. --- WHATS_NEW | 1 + lib/filters/filter.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index d7dda58f0..082b414e8 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Give precedence to EMC power2 devices with duplicate PVIDs. Add --validate option to lvm dumpconfig to validate current config on demand. Add --ignoreadvanced and --ignoreunsupported switch to lvm dumpconfig. Add --withcomments and --withversions switch to lvm dumpconfig. diff --git a/lib/filters/filter.c b/lib/filters/filter.c index 6981b94d9..79254409f 100644 --- a/lib/filters/filter.c +++ b/lib/filters/filter.c @@ -42,6 +42,7 @@ static int _blkext_major = -1; static int _drbd_major = -1; static int _device_mapper_major = -1; static int _emcpower_major = -1; +static int _power2_major = -1; int dm_major(void) { @@ -71,6 +72,9 @@ int dev_subsystem_part_major(const struct device *dev) if (MAJOR(dev->dev) == _emcpower_major) return 1; + if (MAJOR(dev->dev) == _power2_major) + return 1; + if ((MAJOR(dev->dev) == _blkext_major) && (get_primary_dev(sysfs_dir_path(), dev, &primary_dev)) && (MAJOR(primary_dev) == _md_major)) @@ -90,6 +94,9 @@ const char *dev_subsystem_name(const struct device *dev) if (MAJOR(dev->dev) == _emcpower_major) return "EMCPOWER"; + if (MAJOR(dev->dev) == _power2_major) + return "POWER2"; + if (MAJOR(dev->dev) == _blkext_major) return "BLKEXT"; @@ -228,6 +235,9 @@ static int _scan_proc_dev(const char *proc, const struct dm_config_node *cn) if (!strncmp("emcpower", line + i, 8) && isspace(*(line + i + 8))) _emcpower_major = line_maj; + if (!strncmp("power2", line + i, 6) && isspace(*(line + i + 6))) + _power2_major = line_maj; + /* Look for device-mapper device */ /* FIXME Cope with multiple majors */ if (!strncmp("device-mapper", line + i, 13) && isspace(*(line + i + 13)))