Non-partitionable devices, like zoned block devices, aren't showing
up in in /proc/partitions and therefore we cannot rely on it to get
a device's size.
Use blockdev --getsz to get the block device size.
Cc: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
# return device size in kb
_get_device_size()
{
# return device size in kb
_get_device_size()
{
- grep -w `_short_dev $1` /proc/partitions | awk '{print $3}'
+ echo $(($(blockdev --getsz $1) >> 1))
}
# Make sure we actually have dmesg checking set up.
}
# Make sure we actually have dmesg checking set up.