| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Functions related to setting various queue properties from drivers |
|---|
| 3 | 4 | */ |
|---|
| .. | .. |
|---|
| 48 | 49 | struct request *rq, int at_head, |
|---|
| 49 | 50 | rq_end_io_fn *done) |
|---|
| 50 | 51 | { |
|---|
| 51 | | - int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK; |
|---|
| 52 | | - |
|---|
| 53 | 52 | WARN_ON(irqs_disabled()); |
|---|
| 54 | 53 | WARN_ON(!blk_rq_is_passthrough(rq)); |
|---|
| 55 | 54 | |
|---|
| 56 | 55 | rq->rq_disk = bd_disk; |
|---|
| 57 | 56 | rq->end_io = done; |
|---|
| 58 | 57 | |
|---|
| 58 | + blk_account_io_start(rq); |
|---|
| 59 | + |
|---|
| 59 | 60 | /* |
|---|
| 60 | 61 | * don't check dying flag for MQ because the request won't |
|---|
| 61 | 62 | * be reused after dying flag is set |
|---|
| 62 | 63 | */ |
|---|
| 63 | | - if (q->mq_ops) { |
|---|
| 64 | | - blk_mq_sched_insert_request(rq, at_head, true, false); |
|---|
| 65 | | - return; |
|---|
| 66 | | - } |
|---|
| 67 | | - |
|---|
| 68 | | - spin_lock_irq(q->queue_lock); |
|---|
| 69 | | - |
|---|
| 70 | | - if (unlikely(blk_queue_dying(q))) { |
|---|
| 71 | | - rq->rq_flags |= RQF_QUIET; |
|---|
| 72 | | - __blk_end_request_all(rq, BLK_STS_IOERR); |
|---|
| 73 | | - spin_unlock_irq(q->queue_lock); |
|---|
| 74 | | - return; |
|---|
| 75 | | - } |
|---|
| 76 | | - |
|---|
| 77 | | - __elv_add_request(q, rq, where); |
|---|
| 78 | | - __blk_run_queue(q); |
|---|
| 79 | | - spin_unlock_irq(q->queue_lock); |
|---|
| 64 | + blk_mq_sched_insert_request(rq, at_head, true, false); |
|---|
| 80 | 65 | } |
|---|
| 81 | 66 | EXPORT_SYMBOL_GPL(blk_execute_rq_nowait); |
|---|
| 82 | 67 | |
|---|