loop.c (9a6327d2f25b14cb568ca2c55ccbc8f00aa400e4) | loop.c (62b83b1834184a11032c7b13679a6427119fbd84) |
---|---|
1/* 2 * NVMe over Fabrics loopback device. 3 * Copyright (c) 2015-2016 HGST, a Western Digital Company. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * --- 218 unchanged lines hidden (view full) --- 227 INIT_WORK(&iod->work, nvme_loop_execute_work); 228 return 0; 229} 230 231static int nvme_loop_init_request(struct blk_mq_tag_set *set, 232 struct request *req, unsigned int hctx_idx, 233 unsigned int numa_node) 234{ | 1/* 2 * NVMe over Fabrics loopback device. 3 * Copyright (c) 2015-2016 HGST, a Western Digital Company. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * --- 218 unchanged lines hidden (view full) --- 227 INIT_WORK(&iod->work, nvme_loop_execute_work); 228 return 0; 229} 230 231static int nvme_loop_init_request(struct blk_mq_tag_set *set, 232 struct request *req, unsigned int hctx_idx, 233 unsigned int numa_node) 234{ |
235 return nvme_loop_init_iod(set->driver_data, blk_mq_rq_to_pdu(req), 236 hctx_idx + 1); 237} | 235 struct nvme_loop_ctrl *ctrl = set->driver_data; |
238 | 236 |
239static int nvme_loop_init_admin_request(struct blk_mq_tag_set *set, 240 struct request *req, unsigned int hctx_idx, 241 unsigned int numa_node) 242{ 243 return nvme_loop_init_iod(set->driver_data, blk_mq_rq_to_pdu(req), 0); | 237 return nvme_loop_init_iod(ctrl, blk_mq_rq_to_pdu(req), 238 (set == &ctrl->tag_set) ? hctx_idx + 1 : 0); |
244} 245 246static int nvme_loop_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, 247 unsigned int hctx_idx) 248{ 249 struct nvme_loop_ctrl *ctrl = data; 250 struct nvme_loop_queue *queue = &ctrl->queues[hctx_idx + 1]; 251 --- 21 unchanged lines hidden (view full) --- 273 .init_request = nvme_loop_init_request, 274 .init_hctx = nvme_loop_init_hctx, 275 .timeout = nvme_loop_timeout, 276}; 277 278static const struct blk_mq_ops nvme_loop_admin_mq_ops = { 279 .queue_rq = nvme_loop_queue_rq, 280 .complete = nvme_loop_complete_rq, | 239} 240 241static int nvme_loop_init_hctx(struct blk_mq_hw_ctx *hctx, void *data, 242 unsigned int hctx_idx) 243{ 244 struct nvme_loop_ctrl *ctrl = data; 245 struct nvme_loop_queue *queue = &ctrl->queues[hctx_idx + 1]; 246 --- 21 unchanged lines hidden (view full) --- 268 .init_request = nvme_loop_init_request, 269 .init_hctx = nvme_loop_init_hctx, 270 .timeout = nvme_loop_timeout, 271}; 272 273static const struct blk_mq_ops nvme_loop_admin_mq_ops = { 274 .queue_rq = nvme_loop_queue_rq, 275 .complete = nvme_loop_complete_rq, |
281 .init_request = nvme_loop_init_admin_request, | 276 .init_request = nvme_loop_init_request, |
282 .init_hctx = nvme_loop_init_admin_hctx, 283 .timeout = nvme_loop_timeout, 284}; 285 286static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl) 287{ 288 nvmet_sq_destroy(&ctrl->queues[0].nvme_sq); 289 blk_cleanup_queue(ctrl->ctrl.admin_q); --- 483 unchanged lines hidden --- | 277 .init_hctx = nvme_loop_init_admin_hctx, 278 .timeout = nvme_loop_timeout, 279}; 280 281static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl) 282{ 283 nvmet_sq_destroy(&ctrl->queues[0].nvme_sq); 284 blk_cleanup_queue(ctrl->ctrl.admin_q); --- 483 unchanged lines hidden --- |