diff options
author | Jens Axboe <axboe@fb.com> | 2014-11-14 11:47:32 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-11-20 13:10:03 -0500 |
commit | 2c30540b38d683d4c7f06d13a451f67d4362d7b1 (patch) | |
tree | 490cba2c04664298b43e2e5b62a2fb428a3ca345 /drivers/block/nvme-core.c | |
parent | e32efbfc35c1b06f1bfe3e6d737acdd14d27baed (diff) |
NVMe: add ->exit_hctx() hook
If we do teardown and setup of the queue and block related parts
of the driver, then we should clear nvmeq->hctx once we kill the
hardware queue.
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/nvme-core.c')
-rw-r--r-- | drivers/block/nvme-core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 9310fe51382e..ba278ae00705 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
@@ -171,6 +171,13 @@ static int nvme_admin_init_request(void *data, struct request *req, | |||
171 | return 0; | 171 | return 0; |
172 | } | 172 | } |
173 | 173 | ||
174 | static void nvme_exit_hctx(struct blk_mq_hw_ctx *hctx, unsigned int hctx_idx) | ||
175 | { | ||
176 | struct nvme_queue *nvmeq = hctx->driver_data; | ||
177 | |||
178 | nvmeq->hctx = NULL; | ||
179 | } | ||
180 | |||
174 | static int nvme_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, | 181 | static int nvme_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, |
175 | unsigned int hctx_idx) | 182 | unsigned int hctx_idx) |
176 | { | 183 | { |
@@ -1335,6 +1342,7 @@ static struct blk_mq_ops nvme_mq_admin_ops = { | |||
1335 | .queue_rq = nvme_admin_queue_rq, | 1342 | .queue_rq = nvme_admin_queue_rq, |
1336 | .map_queue = blk_mq_map_queue, | 1343 | .map_queue = blk_mq_map_queue, |
1337 | .init_hctx = nvme_admin_init_hctx, | 1344 | .init_hctx = nvme_admin_init_hctx, |
1345 | .exit_hctx = nvme_exit_hctx, | ||
1338 | .init_request = nvme_admin_init_request, | 1346 | .init_request = nvme_admin_init_request, |
1339 | .timeout = nvme_timeout, | 1347 | .timeout = nvme_timeout, |
1340 | }; | 1348 | }; |
@@ -1343,6 +1351,7 @@ static struct blk_mq_ops nvme_mq_ops = { | |||
1343 | .queue_rq = nvme_queue_rq, | 1351 | .queue_rq = nvme_queue_rq, |
1344 | .map_queue = blk_mq_map_queue, | 1352 | .map_queue = blk_mq_map_queue, |
1345 | .init_hctx = nvme_init_hctx, | 1353 | .init_hctx = nvme_init_hctx, |
1354 | .exit_hctx = nvme_exit_hctx, | ||
1346 | .init_request = nvme_init_request, | 1355 | .init_request = nvme_init_request, |
1347 | .timeout = nvme_timeout, | 1356 | .timeout = nvme_timeout, |
1348 | }; | 1357 | }; |