diff options
author | Hannes Reinecke <hare@suse.de> | 2011-08-24 04:51:13 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-30 15:26:49 -0400 |
commit | d7c48feb38a5cb6d863d69fd5ef6c309971ebe31 (patch) | |
tree | cb2701400ab0992ecb7d8e84d3d9f70d38bbb51c /include/scsi | |
parent | ac81c6a832a8769d1cc7ffda361aa3dc3d8f06dc (diff) |
[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 <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_device.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d371c3ca90c3..f751d37685e0 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) | |||
471 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); | 471 | return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); |
472 | } | 472 | } |
473 | 473 | ||
474 | static inline int scsi_device_tpgs(struct scsi_device *sdev) | ||
475 | { | ||
476 | return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0; | ||
477 | } | ||
478 | |||
474 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ | 479 | #define MODULE_ALIAS_SCSI_DEVICE(type) \ |
475 | MODULE_ALIAS("scsi:t-" __stringify(type) "*") | 480 | MODULE_ALIAS("scsi:t-" __stringify(type) "*") |
476 | #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" | 481 | #define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" |