diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index f96c51f5df401a8e2eb8aa66e2a69d604879d21c..7440de44dd8577e1a3483b2a1c9d581329fe20e9 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -741,10 +741,14 @@ int scsi_cmd_blk_ioctl(struct block_device *bd, fmode_t mode, } EXPORT_SYMBOL(scsi_cmd_blk_ioctl); -void scsi_req_init(struct request *rq) +/** + * scsi_req_init - initialize certain fields of a scsi_request structure + * @req: Pointer to a scsi_request structure. + * Initializes .__cmd[], .cmd, .cmd_len and .sense_len but no other members + * of struct scsi_request. + */ +void scsi_req_init(struct scsi_request *req) { - struct scsi_request *req = scsi_req(rq); - memset(req->__cmd, 0, sizeof(req->__cmd)); req->cmd = req->__cmd; req->cmd_len = BLK_MAX_CDB; diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 37f61acf5a3564c17f09dff872cb4ea1ca5ae9e3..14d1e7d9a1d6f7d0bf5b966c233ae32cdb5d598d 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c @@ -199,7 +199,7 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq) memset(sense, 0, sizeof(*sense)); blk_rq_init(rq->q, sense_rq); - scsi_req_init(sense_rq); + scsi_req_init(req); err = blk_rq_map_kern(drive->queue, sense_rq, sense, sense_len, GFP_NOIO); diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index c60e5ffc92319760900c307ce44f26673776a7c2..01b2adfd8226bf1bcd048100f4e4bcb0f6afb180 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -745,7 +745,7 @@ static void ide_initialize_rq(struct request *rq) { struct ide_request *req = blk_mq_rq_to_pdu(rq); - scsi_req_init(rq); + scsi_req_init(&req->sreq); req->sreq.sense = req->sense; } diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 301a7f706c9a2a416ba3383299ab8622dc1ce8bf..550e29f903b746b121b2bb9daf3fce666243b451 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1123,7 +1123,9 @@ EXPORT_SYMBOL(scsi_init_io); */ void scsi_initialize_rq(struct request *rq) { - scsi_req_init(rq); + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq); + + scsi_req_init(&cmd->req); } EXPORT_SYMBOL(scsi_initialize_rq); diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h index f0c76f9dc28547301d4f67ac76e580560d081989..e0afa445ee4eb495e67b73c3f0540714de075008 100644 --- a/include/scsi/scsi_request.h +++ b/include/scsi/scsi_request.h @@ -27,6 +27,6 @@ static inline void scsi_req_free_cmd(struct scsi_request *req) kfree(req->cmd); } -void scsi_req_init(struct request *); +void scsi_req_init(struct scsi_request *req); #endif /* _SCSI_SCSI_REQUEST_H */