summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-08-30 11:26:23 -0700
committerJens Axboe <axboe@kernel.dk>2012-10-04 11:04:37 +0200
commit3e145e029c07286958c2613a5c6e3af39f4bc8fb (patch)
tree81466944d5141a75639807cda9475986cf2aca64
parent837a1563606df1cbca76e092cbfd5d28904ce663 (diff)
blk-mq: kill hctx from blk_mq_end_io()
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-mq.c4
-rw-r--r--drivers/block/null.c11
-rw-r--r--drivers/block/virtio_blk.c4
-rw-r--r--include/linux/blk-mq.h2
4 files changed, 9 insertions, 12 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index b72d5b638842..2c1a3cada88f 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -180,7 +180,7 @@ static void ipi_end_io(void *data)
* it directly inline, or punt to a local IPI handler on the matching
* remote CPU.
*/
-void blk_mq_end_io(struct blk_mq_hw_ctx *hctx, struct request *rq, int error)
+void blk_mq_end_io(struct request *rq, int error)
{
struct blk_mq_ctx *ctx = rq->mq_ctx;
int cpu;
@@ -395,7 +395,7 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
pr_err("blk-mq: bad return on queue: %d\n", ret);
rq->errors = -EIO;
case BLK_MQ_RQ_QUEUE_ERROR:
- blk_mq_end_io(hctx, rq, rq->errors);
+ blk_mq_end_io(rq, rq->errors);
break;
}
}
diff --git a/drivers/block/null.c b/drivers/block/null.c
index 1d1073b24b42..7f452d402426 100644
--- a/drivers/block/null.c
+++ b/drivers/block/null.c
@@ -77,11 +77,10 @@ static bool use_per_node_hctx = true;
module_param(use_per_node_hctx, bool, S_IRUGO);
MODULE_PARM_DESC(use_per_node_hctx, "Use per-node allocation for hardware context queues. Default: true");
-static void null_complete_request(struct blk_mq_hw_ctx *hctx,
- struct request *rq)
+static void null_complete_request(struct request *rq)
{
if (use_mq)
- blk_mq_end_io(hctx, rq, 0);
+ blk_mq_end_io(rq, 0);
else {
INIT_LIST_HEAD(&rq->queuelist);
blk_end_request_all(rq, 0);
@@ -98,7 +97,7 @@ static enum hrtimer_restart null_request_timer_expired(struct hrtimer *timer)
while ((entry = llist_del_first(&cq->list)) != NULL) {
rq = llist_entry(entry, struct request, ll_list);
- null_complete_request(NULL, rq);
+ null_complete_request(rq);
}
return HRTIMER_NORESTART;
@@ -128,7 +127,7 @@ static void null_ipi_end_io(void *data)
while ((entry = llist_del_first(&cq->list)) != NULL) {
rq = llist_entry(entry, struct request, ll_list);
- null_complete_request(NULL, rq);
+ null_complete_request(rq);
}
}
@@ -160,7 +159,7 @@ static inline void null_handle_rq(struct blk_mq_hw_ctx *hctx,
/* Complete IO by inline, softirq or timer */
switch (irqmode) {
case NULL_IRQ_NONE:
- null_complete_request(hctx, rq);
+ null_complete_request(rq);
break;
case NULL_IRQ_SOFTIRQ:
null_request_end_ipi(rq);
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 1651c51889b7..cf198684c369 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -53,7 +53,6 @@ struct virtio_blk
struct virtblk_req
{
struct request *req;
- struct blk_mq_hw_ctx *hctx;
struct virtio_blk_outhdr out_hdr;
struct virtio_scsi_inhdr in_hdr;
u8 status;
@@ -95,7 +94,7 @@ static void blk_done(struct virtqueue *vq)
break;
}
- blk_mq_end_io(vbr->hctx, vbr->req, error);
+ blk_mq_end_io(vbr->req, error);
mempool_free(vbr, vblk->pool);
}
spin_unlock_irqrestore(vblk->disk->queue->queue_lock, flags);
@@ -114,7 +113,6 @@ static bool do_req(struct blk_mq_hw_ctx *hctx, struct virtio_blk *vblk,
return false;
vbr->req = req;
- vbr->hctx = hctx;
if (req->cmd_flags & REQ_FLUSH) {
vbr->out_hdr.type = VIRTIO_BLK_T_FLUSH;
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 319d3a8cf076..9602a568867b 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -101,7 +101,7 @@ struct blk_mq_hw_ctx *blk_mq_map_single_queue(struct request_queue *, struct blk
struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_reg *, unsigned int);
void blk_mq_free_single_hw_queue(struct blk_mq_hw_ctx *, unsigned int);
-void blk_mq_end_io(struct blk_mq_hw_ctx *hctx, struct request *rq, int error);
+void blk_mq_end_io(struct request *rq, int error);
#define queue_for_each_hw_ctx(q, hctx, i) \
for ((i) = 0, hctx = (q)->queue_hw_ctx[0]; \