From d7c48feb38a5cb6d863d69fd5ef6c309971ebe31 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Wed, 24 Aug 2011 10:51:13 +0200 Subject: [SCSI] scsi_dh_alua: Evaluate TPGS setting from inquiry data Instead of issuing a standard inquiry from within the alua device handler we can evaluate the TPGS setting from the existing inquiry data of the sdev and save us the I/O. Signed-off-by: Hannes Reinecke Signed-off-by: James Bottomley --- include/scsi/scsi_device.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/scsi/scsi_device.h') diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d371c3c..f751d37 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -471,6 +471,11 @@ static inline int scsi_device_protection(struct scsi_device *sdev) return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); } +static inline int scsi_device_tpgs(struct scsi_device *sdev) +{ + return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; +} + #define MODULE_ALIAS_SCSI_DEVICE(type) \ MODULE_ALIAS("scsi:t-" __stringify(type) "*") #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" -- cgit v1.1