]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/scsi/scsi_cmnd.h
Merge tag 'dm-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
[karo-tx-linux.git] / include / scsi / scsi_cmnd.h
index a100c6e266c7d4037e872af5a5961c915462e2d7..e0ae71098144ac9511f5ba315102e74e1d4e0516 100644 (file)
@@ -134,6 +134,15 @@ struct scsi_cmnd {
        unsigned char tag;      /* SCSI-II queued command tag */
 };
 
+/*
+ * Return the driver private allocation behind the command.
+ * Only works if cmd_size is set in the host template.
+ */
+static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd)
+{
+       return cmd + 1;
+}
+
 /* make sure not to use it with REQ_TYPE_BLOCK_PC commands */
 static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
 {
@@ -309,7 +318,7 @@ static inline void set_driver_byte(struct scsi_cmnd *cmd, char status)
 
 static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd)
 {
-       unsigned int xfer_len = blk_rq_bytes(scmd->request);
+       unsigned int xfer_len = scsi_out(scmd)->length;
        unsigned int prot_op = scsi_get_prot_op(scmd);
        unsigned int sector_size = scmd->device->sector_size;