commit c97fe35b5b6d767b88419fa2084a59e986ac3da0 Author: Nathan Lynch Date: Mon Apr 27 20:48:04 2020 -0500 ofpathname: speed up l2of_scsi() There is no need to search the entire /sys hierarchy for kernel device names like "sda". We know that if it is present it will be in /sys/class/block. In an environment with more than 800 scsi devices, this brings the execution time for a command like "lsdevinfo -F name -c -q parent=host1" from over 20 minutes to under two minutes. Signed-off-by: Nathan Lynch Signed-off-by: Tyrel Datwyler diff --git a/scripts/ofpathname b/scripts/ofpathname index 7c6345e..bd61ee0 100755 --- a/scripts/ofpathname +++ b/scripts/ofpathname @@ -773,7 +773,7 @@ l2of_scsi() local devtype # There may be many instances of DEVICE under /sys - for dir in `$FIND /sys -name $DEVICE`; do + for dir in `$FIND /sys/class/block -name $DEVICE`; do # Move up until we find one with a device link goto_dir $dir "device" 0 if [ $? -eq 0 ]; then