1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

devices: Do not support unpartitioned DASD.

This commit is contained in:
Alasdair G Kergon 2015-01-23 20:01:34 +00:00
parent 4f5ce1fa43
commit dab3ebce4c
3 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.116 -
====================================
Do not support unpartitioned DASD devices.
Improve config validation to check if setting with string value can be empty.
Version 2.02.115 - 21st January 2015

View File

@ -112,6 +112,10 @@ struct dev_types *create_dev_types(const char *proc_dir,
if (!strncmp("drbd", line + i, 4) && isspace(*(line + i + 4)))
dt->drbd_major = line_maj;
/* Look for DASD */
if (!strncmp("dasd", line + i, 4) && isspace(*(line + i + 4)))
dt->dasd_major = line_maj;
/* Look for EMC powerpath */
if (!strncmp("emcpower", line + i, 8) && isspace(*(line + i + 8)))
dt->emcpower_major = line_maj;
@ -203,6 +207,9 @@ int dev_subsystem_part_major(struct dev_types *dt, struct device *dev)
if (MAJOR(dev->dev) == dt->emcpower_major)
return 1;
if (MAJOR(dev->dev) == dt->dasd_major)
return 1;
if (MAJOR(dev->dev) == dt->power2_major)
return 1;
@ -222,6 +229,9 @@ const char *dev_subsystem_name(struct dev_types *dt, struct device *dev)
if (MAJOR(dev->dev) == dt->drbd_major)
return "DRBD";
if (MAJOR(dev->dev) == dt->dasd_major)
return "DASD";
if (MAJOR(dev->dev) == dt->emcpower_major)
return "EMCPOWER";
@ -322,6 +332,10 @@ int dev_is_partitioned(struct dev_types *dt, struct device *dev)
if (!_is_partitionable(dt, dev))
return 0;
/* Unpartitioned DASD devices are not supported. */
if (MAJOR(dev->dev) == dt->dasd_major)
return 1;
return _has_partition_table(dev);
}

View File

@ -44,6 +44,7 @@ struct dev_types {
int device_mapper_major;
int emcpower_major;
int power2_major;
int dasd_major;
struct dev_type_def dev_type_array[NUMBER_OF_MAJORS];
};