Message ID | 1428076703-31014-4-git-send-email-axboe@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Apr 03, 2015 at 09:58:19AM -0600, Jens Axboe wrote: > +static inline void *scsi_mq_scmd_to_pdu(struct scsi_cmnd *scmd) > +{ > + return blk_mq_rq_to_pdu(scmd->request) + sizeof(*scmd); > +} We've already got scsi_cmd_priv to cover this. > +static inline bool scsi_mq_scmd_started(struct scsi_cmnd *scmd) > +{ > + return blk_mq_request_started(scmd->request); > +} I don't really think we want to expose this functionality, but more on that in my reply to the mpt2 patch. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 9fc1aecfc813..df02c89e8714 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -8,6 +8,7 @@ #include <linux/timer.h> #include <linux/scatterlist.h> #include <scsi/scsi_device.h> +#include <linux/blk-mq.h> struct Scsi_Host; struct scsi_driver; @@ -155,6 +156,16 @@ static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) return *(struct scsi_driver **)cmd->request->rq_disk->private_data; } +static inline void *scsi_mq_scmd_to_pdu(struct scsi_cmnd *scmd) +{ + return blk_mq_rq_to_pdu(scmd->request) + sizeof(*scmd); +} + +static inline bool scsi_mq_scmd_started(struct scsi_cmnd *scmd) +{ + return blk_mq_request_started(scmd->request); +} + extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); extern void scsi_put_command(struct scsi_cmnd *); extern void scsi_finish_command(struct scsi_cmnd *cmd);
scsi_mq_scmd_to_pdu() returns the LLD pdu associated with a struct scsi_cmnd. scsi_mq_scmd_start() returns whether or not a given scsi command has been started or not. Signed-off-by: Jens Axboe <axboe@fb.com> --- include/scsi/scsi_cmnd.h | 11 +++++++++++ 1 file changed, 11 insertions(+)