summaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2008-08-22 16:43:59 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 11:46:13 -0500
commit0f1d87a2acb8fd1f2ef8af109a785123ddc1a6cb (patch)
treec59113a5f6ba81983e1bc4abad235436b1842f28 /include/scsi
parent22447be7d15aefcfab84e9bec4859a28198b0c62 (diff)
downloadblackbird-op-linux-0f1d87a2acb8fd1f2ef8af109a785123ddc1a6cb.tar.gz
blackbird-op-linux-0f1d87a2acb8fd1f2ef8af109a785123ddc1a6cb.zip
[SCSI] add inline functions for recognising created and blocked states
The created and blocked states are very shortly going to correspond to mixed sdev_state states. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/scsi_device.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 80b2e93c2936..cc46652e4658 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -384,10 +384,21 @@ static inline unsigned int sdev_id(struct scsi_device *sdev)
#define scmd_id(scmd) sdev_id((scmd)->device)
#define scmd_channel(scmd) sdev_channel((scmd)->device)
+/*
+ * checks for positions of the SCSI state machine
+ */
static inline int scsi_device_online(struct scsi_device *sdev)
{
return sdev->sdev_state != SDEV_OFFLINE;
}
+static inline int scsi_device_blocked(struct scsi_device *sdev)
+{
+ return sdev->sdev_state == SDEV_BLOCK;
+}
+static inline int scsi_device_created(struct scsi_device *sdev)
+{
+ return sdev->sdev_state == SDEV_CREATED;
+}
/* accessor functions for the SCSI parameters */
static inline int scsi_device_sync(struct scsi_device *sdev)
OpenPOWER on IntegriCloud