scsi: aha1542: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-16-bvanassche@acm.org Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Родитель
40e16ce7b6
Коммит
11bf4ec580
|
@ -262,11 +262,12 @@ static void aha1542_free_cmd(struct scsi_cmnd *cmd)
|
|||
struct aha1542_cmd *acmd = scsi_cmd_priv(cmd);
|
||||
|
||||
if (cmd->sc_data_direction == DMA_FROM_DEVICE) {
|
||||
struct request *rq = scsi_cmd_to_rq(cmd);
|
||||
void *buf = acmd->data_buffer;
|
||||
struct req_iterator iter;
|
||||
struct bio_vec bv;
|
||||
|
||||
rq_for_each_segment(bv, cmd->request, iter) {
|
||||
rq_for_each_segment(bv, rq, iter) {
|
||||
memcpy_to_page(bv.bv_page, bv.bv_offset, buf,
|
||||
bv.bv_len);
|
||||
buf += bv.bv_len;
|
||||
|
@ -447,11 +448,12 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd)
|
|||
#endif
|
||||
|
||||
if (cmd->sc_data_direction == DMA_TO_DEVICE) {
|
||||
struct request *rq = scsi_cmd_to_rq(cmd);
|
||||
void *buf = acmd->data_buffer;
|
||||
struct req_iterator iter;
|
||||
struct bio_vec bv;
|
||||
|
||||
rq_for_each_segment(bv, cmd->request, iter) {
|
||||
rq_for_each_segment(bv, rq, iter) {
|
||||
memcpy_from_page(buf, bv.bv_page, bv.bv_offset,
|
||||
bv.bv_len);
|
||||
buf += bv.bv_len;
|
||||
|
|
Загрузка…
Ссылка в новой задаче