Commit c1ea387d authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: smartpqi: Stop using the SCSI pointer

Set .cmd_size in the SCSI host template instead of using the SCSI pointer
from struct scsi_cmnd. This patch prepares for removal of the SCSI pointer
from struct scsi_cmnd.

Link: https://lore.kernel.org/r/20220218195117.25689-44-bvanassche@acm.orgReviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 55976163
...@@ -54,6 +54,15 @@ MODULE_DESCRIPTION("Driver for Microchip Smart Family Controller version " ...@@ -54,6 +54,15 @@ MODULE_DESCRIPTION("Driver for Microchip Smart Family Controller version "
MODULE_VERSION(DRIVER_VERSION); MODULE_VERSION(DRIVER_VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
struct pqi_cmd_priv {
int this_residual;
};
static struct pqi_cmd_priv *pqi_cmd_priv(struct scsi_cmnd *cmd)
{
return scsi_cmd_priv(cmd);
}
static void pqi_verify_structures(void); static void pqi_verify_structures(void);
static void pqi_take_ctrl_offline(struct pqi_ctrl_info *ctrl_info, static void pqi_take_ctrl_offline(struct pqi_ctrl_info *ctrl_info,
enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason); enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason);
...@@ -5552,7 +5561,7 @@ static void pqi_aio_io_complete(struct pqi_io_request *io_request, ...@@ -5552,7 +5561,7 @@ static void pqi_aio_io_complete(struct pqi_io_request *io_request,
scsi_dma_unmap(scmd); scsi_dma_unmap(scmd);
if (io_request->status == -EAGAIN || pqi_raid_bypass_retry_needed(io_request)) { if (io_request->status == -EAGAIN || pqi_raid_bypass_retry_needed(io_request)) {
set_host_byte(scmd, DID_IMM_RETRY); set_host_byte(scmd, DID_IMM_RETRY);
scmd->SCp.this_residual++; pqi_cmd_priv(scmd)->this_residual++;
} }
pqi_free_io_request(io_request); pqi_free_io_request(io_request);
...@@ -5814,7 +5823,7 @@ static inline bool pqi_is_bypass_eligible_request(struct scsi_cmnd *scmd) ...@@ -5814,7 +5823,7 @@ static inline bool pqi_is_bypass_eligible_request(struct scsi_cmnd *scmd)
if (blk_rq_is_passthrough(scsi_cmd_to_rq(scmd))) if (blk_rq_is_passthrough(scsi_cmd_to_rq(scmd)))
return false; return false;
return scmd->SCp.this_residual == 0; return pqi_cmd_priv(scmd)->this_residual == 0;
} }
/* /*
...@@ -7262,6 +7271,7 @@ static struct scsi_host_template pqi_driver_template = { ...@@ -7262,6 +7271,7 @@ static struct scsi_host_template pqi_driver_template = {
.map_queues = pqi_map_queues, .map_queues = pqi_map_queues,
.sdev_groups = pqi_sdev_groups, .sdev_groups = pqi_sdev_groups,
.shost_groups = pqi_shost_groups, .shost_groups = pqi_shost_groups,
.cmd_size = sizeof(struct pqi_cmd_priv),
}; };
static int pqi_register_scsi(struct pqi_ctrl_info *ctrl_info) static int pqi_register_scsi(struct pqi_ctrl_info *ctrl_info)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment