aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/null_blk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/null_blk.c')
-rw-r--r--drivers/block/null_blk.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index b5d842370cc9..f370fc13aea5 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -223,7 +223,7 @@ static void null_softirq_done_fn(struct request *rq)
223 blk_end_request_all(rq, 0); 223 blk_end_request_all(rq, 0);
224} 224}
225 225
226#if defined(CONFIG_SMP) && defined(CONFIG_USE_GENERIC_SMP_HELPERS) 226#ifdef CONFIG_SMP
227 227
228static void null_ipi_cmd_end_io(void *data) 228static void null_ipi_cmd_end_io(void *data)
229{ 229{
@@ -260,7 +260,7 @@ static void null_cmd_end_ipi(struct nullb_cmd *cmd)
260 put_cpu(); 260 put_cpu();
261} 261}
262 262
263#endif /* CONFIG_SMP && CONFIG_USE_GENERIC_SMP_HELPERS */ 263#endif /* CONFIG_SMP */
264 264
265static inline void null_handle_cmd(struct nullb_cmd *cmd) 265static inline void null_handle_cmd(struct nullb_cmd *cmd)
266{ 266{
@@ -270,7 +270,7 @@ static inline void null_handle_cmd(struct nullb_cmd *cmd)
270 end_cmd(cmd); 270 end_cmd(cmd);
271 break; 271 break;
272 case NULL_IRQ_SOFTIRQ: 272 case NULL_IRQ_SOFTIRQ:
273#if defined(CONFIG_SMP) && defined(CONFIG_USE_GENERIC_SMP_HELPERS) 273#ifdef CONFIG_SMP
274 null_cmd_end_ipi(cmd); 274 null_cmd_end_ipi(cmd);
275#else 275#else
276 end_cmd(cmd); 276 end_cmd(cmd);
@@ -495,23 +495,23 @@ static int null_add_dev(void)
495 495
496 spin_lock_init(&nullb->lock); 496 spin_lock_init(&nullb->lock);
497 497
498 if (queue_mode == NULL_Q_MQ && use_per_node_hctx)
499 submit_queues = nr_online_nodes;
500
498 if (setup_queues(nullb)) 501 if (setup_queues(nullb))
499 goto err; 502 goto err;
500 503
501 if (queue_mode == NULL_Q_MQ) { 504 if (queue_mode == NULL_Q_MQ) {
502 null_mq_reg.numa_node = home_node; 505 null_mq_reg.numa_node = home_node;
503 null_mq_reg.queue_depth = hw_queue_depth; 506 null_mq_reg.queue_depth = hw_queue_depth;
507 null_mq_reg.nr_hw_queues = submit_queues;
504 508
505 if (use_per_node_hctx) { 509 if (use_per_node_hctx) {
506 null_mq_reg.ops->alloc_hctx = null_alloc_hctx; 510 null_mq_reg.ops->alloc_hctx = null_alloc_hctx;
507 null_mq_reg.ops->free_hctx = null_free_hctx; 511 null_mq_reg.ops->free_hctx = null_free_hctx;
508
509 null_mq_reg.nr_hw_queues = nr_online_nodes;
510 } else { 512 } else {
511 null_mq_reg.ops->alloc_hctx = blk_mq_alloc_single_hw_queue; 513 null_mq_reg.ops->alloc_hctx = blk_mq_alloc_single_hw_queue;
512 null_mq_reg.ops->free_hctx = blk_mq_free_single_hw_queue; 514 null_mq_reg.ops->free_hctx = blk_mq_free_single_hw_queue;
513
514 null_mq_reg.nr_hw_queues = submit_queues;
515 } 515 }
516 516
517 nullb->q = blk_mq_init_queue(&null_mq_reg, nullb); 517 nullb->q = blk_mq_init_queue(&null_mq_reg, nullb);
@@ -571,7 +571,7 @@ static int __init null_init(void)
571{ 571{
572 unsigned int i; 572 unsigned int i;
573 573
574#if !defined(CONFIG_SMP) || !defined(CONFIG_USE_GENERIC_SMP_HELPERS) 574#if !defined(CONFIG_SMP)
575 if (irqmode == NULL_IRQ_SOFTIRQ) { 575 if (irqmode == NULL_IRQ_SOFTIRQ) {
576 pr_warn("null_blk: softirq completions not available.\n"); 576 pr_warn("null_blk: softirq completions not available.\n");
577 pr_warn("null_blk: using direct completions.\n"); 577 pr_warn("null_blk: using direct completions.\n");