Commit 2cece377 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: scsi_ioctl: Remove scsi_req_init()

Merge scsi_req_init() into its only caller.

Link: https://lore.kernel.org/r/20210724072033.1284840-16-hch@lst.deSigned-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 78011042
...@@ -817,21 +817,6 @@ int scsi_cmd_ioctl(struct request_queue *q, struct gendisk *bd_disk, fmode_t mod ...@@ -817,21 +817,6 @@ int scsi_cmd_ioctl(struct request_queue *q, struct gendisk *bd_disk, fmode_t mod
} }
EXPORT_SYMBOL(scsi_cmd_ioctl); EXPORT_SYMBOL(scsi_cmd_ioctl);
/**
* 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)
{
memset(req->__cmd, 0, sizeof(req->__cmd));
req->cmd = req->__cmd;
req->cmd_len = BLK_MAX_CDB;
req->sense_len = 0;
}
EXPORT_SYMBOL(scsi_req_init);
static int __init blk_scsi_ioctl_init(void) static int __init blk_scsi_ioctl_init(void)
{ {
blk_set_cmd_filter_defaults(&blk_default_cmd_filter); blk_set_cmd_filter_defaults(&blk_default_cmd_filter);
......
...@@ -1083,8 +1083,13 @@ EXPORT_SYMBOL(scsi_alloc_sgtables); ...@@ -1083,8 +1083,13 @@ EXPORT_SYMBOL(scsi_alloc_sgtables);
static void scsi_initialize_rq(struct request *rq) static void scsi_initialize_rq(struct request *rq)
{ {
struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq); struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq);
struct scsi_request *req = &cmd->req;
memset(req->__cmd, 0, sizeof(req->__cmd));
req->cmd = req->__cmd;
req->cmd_len = BLK_MAX_CDB;
req->sense_len = 0;
scsi_req_init(&cmd->req);
init_rcu_head(&cmd->rcu); init_rcu_head(&cmd->rcu);
cmd->jiffies_at_alloc = jiffies; cmd->jiffies_at_alloc = jiffies;
cmd->retries = 0; cmd->retries = 0;
......
...@@ -28,6 +28,4 @@ static inline void scsi_req_free_cmd(struct scsi_request *req) ...@@ -28,6 +28,4 @@ static inline void scsi_req_free_cmd(struct scsi_request *req)
kfree(req->cmd); kfree(req->cmd);
} }
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