mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
ZTS: Add helper for disk device check
Replace `test -b` and equivalents with `is_disk_device`, so that `-c` is used instead on FreeBSD which has no block cache layer for devices. Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9795
This commit is contained in:
committed by
Brian Behlendorf
parent
d7164b27be
commit
665684d721
@@ -30,7 +30,7 @@ else
|
||||
DISK1=${DISKS%% *}
|
||||
|
||||
typeset -i max_discard=0
|
||||
if [[ -b $DEV_RDSKDIR/$DISK1 ]]; then
|
||||
if is_disk_device $DEV_RDSKDIR/$DISK1; then
|
||||
max_discard=$(lsblk -Dbn $DEV_RDSKDIR/$DISK1 | awk '{ print $4; exit }')
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user