Commit c8d9cf22 authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe

block: Change argument type of scsi_req_init()

Since scsi_req_init() works on a struct scsi_request, change the
argument type into struct scsi_request *.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ca18d6f7
...@@ -741,10 +741,14 @@ int scsi_cmd_blk_ioctl(struct block_device *bd, fmode_t mode, ...@@ -741,10 +741,14 @@ int scsi_cmd_blk_ioctl(struct block_device *bd, fmode_t mode,
} }
EXPORT_SYMBOL(scsi_cmd_blk_ioctl); 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)); memset(req->__cmd, 0, sizeof(req->__cmd));
req->cmd = req->__cmd; req->cmd = req->__cmd;
req->cmd_len = BLK_MAX_CDB; req->cmd_len = BLK_MAX_CDB;
......
...@@ -199,7 +199,7 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq) ...@@ -199,7 +199,7 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq)
memset(sense, 0, sizeof(*sense)); memset(sense, 0, sizeof(*sense));
blk_rq_init(rq->q, sense_rq); 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, err = blk_rq_map_kern(drive->queue, sense_rq, sense, sense_len,
GFP_NOIO); GFP_NOIO);
......
...@@ -745,7 +745,7 @@ static void ide_initialize_rq(struct request *rq) ...@@ -745,7 +745,7 @@ static void ide_initialize_rq(struct request *rq)
{ {
struct ide_request *req = blk_mq_rq_to_pdu(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; req->sreq.sense = req->sense;
} }
......
...@@ -1123,7 +1123,9 @@ EXPORT_SYMBOL(scsi_init_io); ...@@ -1123,7 +1123,9 @@ EXPORT_SYMBOL(scsi_init_io);
*/ */
void scsi_initialize_rq(struct request *rq) 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); EXPORT_SYMBOL(scsi_initialize_rq);
......
...@@ -27,6 +27,6 @@ static inline void scsi_req_free_cmd(struct scsi_request *req) ...@@ -27,6 +27,6 @@ static inline void scsi_req_free_cmd(struct scsi_request *req)
kfree(req->cmd); kfree(req->cmd);
} }
void scsi_req_init(struct request *); void scsi_req_init(struct scsi_request *req);
#endif /* _SCSI_SCSI_REQUEST_H */ #endif /* _SCSI_SCSI_REQUEST_H */
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