1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

filters: power2 devs get precedence if PVIDs match

Give precedence to EMC "power2" devices with duplicate PVIDs like
we already do with "emcpower" devices.
This commit is contained in:
Alasdair G Kergon 2013-03-11 20:10:49 +00:00
parent 69ae454d4d
commit cbfb5a98b5
2 changed files with 11 additions and 0 deletions

View File

@ -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.

View File

@ -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)))