mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
lszfcp: save a stat syscall on the SCSI device loop hot path
Just go ahead and read the sysfs attribute directly as the syscalls are needed anyway. If necessary stderr could be redirected to /dev/null in the future, but there was no case so far where the attribute did not exist. This does not make a runtime difference when running on sysfs. Change it anyway to avoid somebody searching for speed improvement options stumbling over it again. Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Steffen Maier <maier@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
a4f4337060
commit
d4316c155c
+1
-2
@@ -415,8 +415,7 @@ show_devices()
|
||||
SDEVMARKER=""
|
||||
if $SHOW_EXTENDED; then
|
||||
[ -d $ZFCP_UNIT_PATH ] || SDEVMARKER="$SDEVMARKER auto"
|
||||
[ -r $SCSI_DEVICE_PATH/state ] \
|
||||
&& read SDEVSTATE < $SCSI_DEVICE_PATH/state
|
||||
read SDEVSTATE < $SCSI_DEVICE_PATH/state
|
||||
[ "$SDEVSTATE" != "running" ] \
|
||||
&& SDEVMARKER="$SDEVMARKER NotRunning"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user