aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-exec.c')
-rw-r--r--block/blk-exec.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/block/blk-exec.c b/block/blk-exec.c
index fb2cbd551621..8b6dc5bd4dd0 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -43,6 +43,9 @@ static void blk_end_sync_rq(struct request *rq, int error)
43 * Description: 43 * Description:
44 * Insert a fully prepared request at the back of the I/O scheduler queue 44 * Insert a fully prepared request at the back of the I/O scheduler queue
45 * for execution. Don't wait for completion. 45 * for execution. Don't wait for completion.
46 *
47 * Note:
48 * This function will invoke @done directly if the queue is dead.
46 */ 49 */
47void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk, 50void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
48 struct request *rq, int at_head, 51 struct request *rq, int at_head,
@@ -51,18 +54,20 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
51 int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK; 54 int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
52 55
53 WARN_ON(irqs_disabled()); 56 WARN_ON(irqs_disabled());
57
58 rq->rq_disk = bd_disk;
59 rq->end_io = done;
60
54 spin_lock_irq(q->queue_lock); 61 spin_lock_irq(q->queue_lock);
55 62
56 if (unlikely(blk_queue_dead(q))) { 63 if (unlikely(blk_queue_dead(q))) {
57 spin_unlock_irq(q->queue_lock);
58 rq->errors = -ENXIO; 64 rq->errors = -ENXIO;
59 if (rq->end_io) 65 if (rq->end_io)
60 rq->end_io(rq, rq->errors); 66 rq->end_io(rq, rq->errors);
67 spin_unlock_irq(q->queue_lock);
61 return; 68 return;
62 } 69 }
63 70
64 rq->rq_disk = bd_disk;
65 rq->end_io = done;
66 __elv_add_request(q, rq, where); 71 __elv_add_request(q, rq, where);
67 __blk_run_queue(q); 72 __blk_run_queue(q);
68 /* the queue is stopped so it won't be run */ 73 /* the queue is stopped so it won't be run */