[PATCH blktests 2/3] common/rc: add one function to get test dev size in mb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Yi Zhang <yi.zhang@xxxxxxxxxx>
---
 common/rc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/rc b/common/rc
index e490041..847be1b 100644
--- a/common/rc
+++ b/common/rc
@@ -324,6 +324,14 @@ _get_pci_parent_from_blkdev() {
 		tail -2 | head -1
 }
 
+_get_test_dev_size_mb() {
+	local test_dev_sz
+	test_dev_sz=$(blockdev --getsize64 "$TEST_DEV")
+
+	echo $((test_dev_sz / 1024 / 1024))
+
+}
+
 _require_test_dev_in_hotplug_slot() {
 	local parent
 	parent="$(_get_pci_parent_from_blkdev)"
-- 
2.34.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux