On 09/02/2023 18:53, Bart Van Assche wrote:
Allow SCSI LLDs to specify SCMD_* flags.
Cc: Mike Christie <michael.christie@xxxxxxxxxx>
Cc: John Garry <john.g.garry@xxxxxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
Just a couple of nits, below:
Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx>
---
drivers/scsi/scsi_lib.c | 1 +
include/scsi/scsi_device.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index abe93ec8b7d0..b7c569a42aa4 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -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;
nit: we zero the scsi_cmnd payload in scsi_alloc_request() ->
scsi_initialize_rq(), so don't really need the bitwise OR. However it
may be better to keep for change of scsi_initialize_rq() changing in
terms of init.
req->timeout = timeout;
req->rq_flags |= RQF_QUIET;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 7e95ec45138f..c7bfb1f5a8e7 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -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 */
+ unsigned int scmd_flags; /* SCMD flags */
nit: scsi_cmnd.flags is an int, so prob should keep the same type
int *resid; /* residual length */
};