aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index ea70e6c80cd3..15de223c7f93 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -366,7 +366,14 @@ void blk_drain_queue(struct request_queue *q, bool drain_all)
366 if (drain_all) 366 if (drain_all)
367 blk_throtl_drain(q); 367 blk_throtl_drain(q);
368 368
369 __blk_run_queue(q); 369 /*
370 * This function might be called on a queue which failed
371 * driver init after queue creation. Some drivers
372 * (e.g. fd) get unhappy in such cases. Kick queue iff
373 * dispatch queue has something on it.
374 */
375 if (!list_empty(&q->queue_head))
376 __blk_run_queue(q);
370 377
371 if (drain_all) 378 if (drain_all)
372 nr_rqs = q->rq.count[0] + q->rq.count[1]; 379 nr_rqs = q->rq.count[0] + q->rq.count[1];
@@ -467,6 +474,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
467 q->backing_dev_info.state = 0; 474 q->backing_dev_info.state = 0;
468 q->backing_dev_info.capabilities = BDI_CAP_MAP_COPY; 475 q->backing_dev_info.capabilities = BDI_CAP_MAP_COPY;
469 q->backing_dev_info.name = "block"; 476 q->backing_dev_info.name = "block";
477 q->node = node_id;
470 478
471 err = bdi_init(&q->backing_dev_info); 479 err = bdi_init(&q->backing_dev_info);
472 if (err) { 480 if (err) {
@@ -551,7 +559,7 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
551 if (!uninit_q) 559 if (!uninit_q)
552 return NULL; 560 return NULL;
553 561
554 q = blk_init_allocated_queue_node(uninit_q, rfn, lock, node_id); 562 q = blk_init_allocated_queue(uninit_q, rfn, lock);
555 if (!q) 563 if (!q)
556 blk_cleanup_queue(uninit_q); 564 blk_cleanup_queue(uninit_q);
557 565
@@ -563,18 +571,9 @@ struct request_queue *
563blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn, 571blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
564 spinlock_t *lock) 572 spinlock_t *lock)
565{ 573{
566 return blk_init_allocated_queue_node(q, rfn, lock, -1);
567}
568EXPORT_SYMBOL(blk_init_allocated_queue);
569
570struct request_queue *
571blk_init_allocated_queue_node(struct request_queue *q, request_fn_proc *rfn,
572 spinlock_t *lock, int node_id)
573{
574 if (!q) 574 if (!q)
575 return NULL; 575 return NULL;
576 576
577 q->node = node_id;
578 if (blk_init_free_list(q)) 577 if (blk_init_free_list(q))
579 return NULL; 578 return NULL;
580 579
@@ -604,7 +603,7 @@ blk_init_allocated_queue_node(struct request_queue *q, request_fn_proc *rfn,
604 603
605 return NULL; 604 return NULL;
606} 605}
607EXPORT_SYMBOL(blk_init_allocated_queue_node); 606EXPORT_SYMBOL(blk_init_allocated_queue);
608 607
609int blk_get_queue(struct request_queue *q) 608int blk_get_queue(struct request_queue *q)
610{ 609{