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

scsi: Document which queue type a function is intended for

Rename several functions to make it easy to see which queue type a
function is intended for.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3991e460
...@@ -2001,8 +2001,8 @@ static enum blk_eh_timer_return scsi_timeout(struct request *req, ...@@ -2001,8 +2001,8 @@ static enum blk_eh_timer_return scsi_timeout(struct request *req,
return scsi_times_out(req); return scsi_times_out(req);
} }
static int scsi_init_request(struct blk_mq_tag_set *set, struct request *rq, static int scsi_mq_init_request(struct blk_mq_tag_set *set, struct request *rq,
unsigned int hctx_idx, unsigned int numa_node) unsigned int hctx_idx, unsigned int numa_node)
{ {
struct Scsi_Host *shost = set->driver_data; struct Scsi_Host *shost = set->driver_data;
const bool unchecked_isa_dma = shost->unchecked_isa_dma; const bool unchecked_isa_dma = shost->unchecked_isa_dma;
...@@ -2026,8 +2026,8 @@ static int scsi_init_request(struct blk_mq_tag_set *set, struct request *rq, ...@@ -2026,8 +2026,8 @@ static int scsi_init_request(struct blk_mq_tag_set *set, struct request *rq,
return 0; return 0;
} }
static void scsi_exit_request(struct blk_mq_tag_set *set, struct request *rq, static void scsi_mq_exit_request(struct blk_mq_tag_set *set, struct request *rq,
unsigned int hctx_idx) unsigned int hctx_idx)
{ {
struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq); struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq);
...@@ -2104,7 +2104,8 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) ...@@ -2104,7 +2104,8 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
} }
EXPORT_SYMBOL_GPL(__scsi_init_queue); EXPORT_SYMBOL_GPL(__scsi_init_queue);
static int scsi_init_rq(struct request_queue *q, struct request *rq, gfp_t gfp) static int scsi_old_init_rq(struct request_queue *q, struct request *rq,
gfp_t gfp)
{ {
struct Scsi_Host *shost = q->rq_alloc_data; struct Scsi_Host *shost = q->rq_alloc_data;
const bool unchecked_isa_dma = shost->unchecked_isa_dma; const bool unchecked_isa_dma = shost->unchecked_isa_dma;
...@@ -2134,7 +2135,7 @@ static int scsi_init_rq(struct request_queue *q, struct request *rq, gfp_t gfp) ...@@ -2134,7 +2135,7 @@ static int scsi_init_rq(struct request_queue *q, struct request *rq, gfp_t gfp)
return -ENOMEM; return -ENOMEM;
} }
static void scsi_exit_rq(struct request_queue *q, struct request *rq) static void scsi_old_exit_rq(struct request_queue *q, struct request *rq)
{ {
struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq); struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq);
...@@ -2144,7 +2145,7 @@ static void scsi_exit_rq(struct request_queue *q, struct request *rq) ...@@ -2144,7 +2145,7 @@ static void scsi_exit_rq(struct request_queue *q, struct request *rq)
cmd->sense_buffer); cmd->sense_buffer);
} }
struct request_queue *scsi_alloc_queue(struct scsi_device *sdev) struct request_queue *scsi_old_alloc_queue(struct scsi_device *sdev)
{ {
struct Scsi_Host *shost = sdev->host; struct Scsi_Host *shost = sdev->host;
struct request_queue *q; struct request_queue *q;
...@@ -2155,8 +2156,8 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev) ...@@ -2155,8 +2156,8 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
q->cmd_size = sizeof(struct scsi_cmnd) + shost->hostt->cmd_size; q->cmd_size = sizeof(struct scsi_cmnd) + shost->hostt->cmd_size;
q->rq_alloc_data = shost; q->rq_alloc_data = shost;
q->request_fn = scsi_request_fn; q->request_fn = scsi_request_fn;
q->init_rq_fn = scsi_init_rq; q->init_rq_fn = scsi_old_init_rq;
q->exit_rq_fn = scsi_exit_rq; q->exit_rq_fn = scsi_old_exit_rq;
q->initialize_rq_fn = scsi_initialize_rq; q->initialize_rq_fn = scsi_initialize_rq;
if (blk_init_allocated_queue(q) < 0) { if (blk_init_allocated_queue(q) < 0) {
...@@ -2180,8 +2181,8 @@ static const struct blk_mq_ops scsi_mq_ops = { ...@@ -2180,8 +2181,8 @@ static const struct blk_mq_ops scsi_mq_ops = {
#ifdef CONFIG_BLK_DEBUG_FS #ifdef CONFIG_BLK_DEBUG_FS
.show_rq = scsi_show_rq, .show_rq = scsi_show_rq,
#endif #endif
.init_request = scsi_init_request, .init_request = scsi_mq_init_request,
.exit_request = scsi_exit_request, .exit_request = scsi_mq_exit_request,
.initialize_rq_fn = scsi_initialize_rq, .initialize_rq_fn = scsi_initialize_rq,
.map_queues = scsi_map_queues, .map_queues = scsi_map_queues,
}; };
......
...@@ -88,7 +88,7 @@ extern void scsi_queue_insert(struct scsi_cmnd *cmd, int reason); ...@@ -88,7 +88,7 @@ extern void scsi_queue_insert(struct scsi_cmnd *cmd, int reason);
extern void scsi_io_completion(struct scsi_cmnd *, unsigned int); extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
extern void scsi_run_host_queues(struct Scsi_Host *shost); extern void scsi_run_host_queues(struct Scsi_Host *shost);
extern void scsi_requeue_run_queue(struct work_struct *work); extern void scsi_requeue_run_queue(struct work_struct *work);
extern struct request_queue *scsi_alloc_queue(struct scsi_device *sdev); extern struct request_queue *scsi_old_alloc_queue(struct scsi_device *sdev);
extern struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev); extern struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev);
extern void scsi_start_queue(struct scsi_device *sdev); extern void scsi_start_queue(struct scsi_device *sdev);
extern int scsi_mq_setup_tags(struct Scsi_Host *shost); extern int scsi_mq_setup_tags(struct Scsi_Host *shost);
......
...@@ -268,7 +268,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, ...@@ -268,7 +268,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
if (shost_use_blk_mq(shost)) if (shost_use_blk_mq(shost))
sdev->request_queue = scsi_mq_alloc_queue(sdev); sdev->request_queue = scsi_mq_alloc_queue(sdev);
else else
sdev->request_queue = scsi_alloc_queue(sdev); sdev->request_queue = scsi_old_alloc_queue(sdev);
if (!sdev->request_queue) { if (!sdev->request_queue) {
/* release fn is set up in scsi_sysfs_device_initialise, so /* release fn is set up in scsi_sysfs_device_initialise, so
* have to free and put manually here */ * have to free and put manually here */
......
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