generic/312: fix dev_blocks calculation
Current calculation fails when there are many same type of devices
with the testing device, eg sda1 sda2 ... sda10, sda11, sda12 ..
$(grep sda1 /proc/partitions) gets multiple numbers.
$ grep ram1 /proc/partitions
1 1
10485760 ram1
1 10
10485760 ram10
1 11
10485760 ram11
1 12
10485760 ram12
1 13
10485760 ram13
1 14
10485760 ram14
1 15
10485760 ram15
$ grep -w ram1 /proc/partitions
1 1
10485760 ram1
Fix this by adding the -w option to grep to match the block device
exactly.
Signed-off-by: Xiong Zhou <xzhou@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>