[kpartx] add DASD large volume support
With kernel 2.6.30 the DASD device driver supports devices with more
then 65520 cylinders. As the traditional record layouts and hardware
interfaces only allow for 16-bit cylinder values, the new larger
cylinder addresses have to be partially encoded into the head part
of a cylinder/head address. To make things complicated, old kernels
will recognize a large volume device, but with a maximum of 65535
cylinders, so a large volume that has been formatted with old tools
will only be partially formatted. To handle these issues our disk
layouts and partition detection code had to be extended, and to use
large volumes with the multipath tools, the DASD partition detection
code in kpartx needs to be extended as well.
compatible disk layout (VOL1 label):
We use the same address encoding as the hardware interfaces.
To prevent old tools and kernels from misinterpreting the encoded
partition sizes, the new VTOC entries have the format number 8
instead of 1.
linux disk layout (LNX1 label):
Here we will still create one partition for the whole disk.
To make sure that the whole disk has been formatted, large volumes
use a new version of the disk label, which contains the number of
formatted blocks. If the disk contains an old volume label, we know
it was formatted with the number of cylinders as reported by the
HDIO_GETGEO ioctl.
CMS disk layout (CMS1 label):
Already contains the number of formatted blocks in the label, we
just have to use it.
Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>