partx: convert hard sector size to 512-byte sectors
The msdos PT depends on a sector size (BLKSSZGET), but partx(8) counts
internally with 512-byte sectors only. The dos.c has to convert start
and size to 512-byte sectors.
sysfs (kernel uses 512-byte sectors only):
# cat /sys/block/sdb/sdb1/{start,size}
256
16128
(note that 16128 * 512 =
8257536; 8Mb)
old version:
# partx /dev/sdb
1: 32- 2047 ( 2016 sectors, 1 MB)
^^^^
start, end and sectors are correct, but in 4KiB sectors
The size in MB is completely wrong.
new version:
# partx -l /dev/sdb
1: 256- 16383 ( 16128 sectors, 8 MB)
start, end and sectors are converted to 512-byte sectors. The size in
MB is correct now.
Note that this change is important, because "partx -a" counts the size
of a new partition in 512-byte sectors for all PT formats (sun, gpt, ...).
Signed-off-by: Karel Zak <kzak@redhat.com>