scsi: core: Extend struct scsi_exec_args
authorBart Van Assche <bvanassche@acm.org>
Fri, 10 Feb 2023 19:32:56 +0000 (11:32 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Feb 2023 03:00:51 +0000 (22:00 -0500)
Allow SCSI LLDs to specify SCMD_* flags.

Link: https://lore.kernel.org/r/20230210193258.4004923-2-bvanassche@acm.org
Cc: Mike Christie <michael.christie@oracle.com>
Cc: John Garry <john.g.garry@oracle.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c
include/scsi/scsi_device.h

index abe93ec8b7d08c7fc4e0bc16d60ed746a737d1f0..b7c569a42aa477551597ff0629fc6c04888277fb 100644 (file)
@@ -229,6 +229,7 @@ int scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd,
        scmd->cmd_len = COMMAND_SIZE(cmd[0]);
        memcpy(scmd->cmnd, cmd, scmd->cmd_len);
        scmd->allowed = retries;
+       scmd->flags |= args->scmd_flags;
        req->timeout = timeout;
        req->rq_flags |= RQF_QUIET;
 
index 7e95ec45138fe53e1d5bbbc382ac39aae2cdc53d..de310f21406c546f7d8d0819e56ef4a9a4ec7ea4 100644 (file)
@@ -462,6 +462,7 @@ struct scsi_exec_args {
        unsigned int sense_len;         /* sense buffer len */
        struct scsi_sense_hdr *sshdr;   /* decoded sense header */
        blk_mq_req_flags_t req_flags;   /* BLK_MQ_REQ flags */
+       int scmd_flags;                 /* SCMD flags */
        int *resid;                     /* residual length */
 };