diff options
| author | Christoph Hellwig <hch@lst.de> | 2014-05-01 10:51:50 -0400 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2014-05-19 13:57:23 -0400 |
| commit | b54197c43db88f4436717f554d623189cddce29e (patch) | |
| tree | d8ea18d1b76b79e5c82a0c17196971d9cfff94a1 /include/scsi | |
| parent | fdbcbcab0eae6773430546697ace0b3fe48e7fbc (diff) | |
virtio_scsi: use cmd_size
Taken almost entirely from Nicholas Bellinger's scsi-mq conversion.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/scsi')
| -rw-r--r-- | include/scsi/scsi_cmnd.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index dd7c998221b3..e016e2ac38df 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
| @@ -133,6 +133,15 @@ struct scsi_cmnd { | |||
| 133 | unsigned char tag; /* SCSI-II queued command tag */ | 133 | unsigned char tag; /* SCSI-II queued command tag */ |
| 134 | }; | 134 | }; |
| 135 | 135 | ||
| 136 | /* | ||
| 137 | * Return the driver private allocation behind the command. | ||
| 138 | * Only works if cmd_size is set in the host template. | ||
| 139 | */ | ||
| 140 | static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd) | ||
| 141 | { | ||
| 142 | return cmd + 1; | ||
| 143 | } | ||
| 144 | |||
| 136 | /* make sure not to use it with REQ_TYPE_BLOCK_PC commands */ | 145 | /* make sure not to use it with REQ_TYPE_BLOCK_PC commands */ |
| 137 | static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) | 146 | static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) |
| 138 | { | 147 | { |
