diff options
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index f8d37a8e2c55..d316662682c8 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -520,6 +520,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) | |||
520 | init_timer(&q->unplug_timer); | 520 | init_timer(&q->unplug_timer); |
521 | setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q); | 521 | setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q); |
522 | INIT_LIST_HEAD(&q->timeout_list); | 522 | INIT_LIST_HEAD(&q->timeout_list); |
523 | INIT_LIST_HEAD(&q->pending_barriers); | ||
523 | INIT_WORK(&q->unplug_work, blk_unplug_work); | 524 | INIT_WORK(&q->unplug_work, blk_unplug_work); |
524 | 525 | ||
525 | kobject_init(&q->kobj, &blk_queue_ktype); | 526 | kobject_init(&q->kobj, &blk_queue_ktype); |
@@ -1185,6 +1186,7 @@ static int __make_request(struct request_queue *q, struct bio *bio) | |||
1185 | const bool sync = (bio->bi_rw & REQ_SYNC); | 1186 | const bool sync = (bio->bi_rw & REQ_SYNC); |
1186 | const bool unplug = (bio->bi_rw & REQ_UNPLUG); | 1187 | const bool unplug = (bio->bi_rw & REQ_UNPLUG); |
1187 | const unsigned int ff = bio->bi_rw & REQ_FAILFAST_MASK; | 1188 | const unsigned int ff = bio->bi_rw & REQ_FAILFAST_MASK; |
1189 | int where = ELEVATOR_INSERT_SORT; | ||
1188 | int rw_flags; | 1190 | int rw_flags; |
1189 | 1191 | ||
1190 | /* REQ_HARDBARRIER is no more */ | 1192 | /* REQ_HARDBARRIER is no more */ |
@@ -1203,7 +1205,12 @@ static int __make_request(struct request_queue *q, struct bio *bio) | |||
1203 | 1205 | ||
1204 | spin_lock_irq(q->queue_lock); | 1206 | spin_lock_irq(q->queue_lock); |
1205 | 1207 | ||
1206 | if (unlikely((bio->bi_rw & REQ_HARDBARRIER)) || elv_queue_empty(q)) | 1208 | if (bio->bi_rw & REQ_HARDBARRIER) { |
1209 | where = ELEVATOR_INSERT_FRONT; | ||
1210 | goto get_rq; | ||
1211 | } | ||
1212 | |||
1213 | if (elv_queue_empty(q)) | ||
1207 | goto get_rq; | 1214 | goto get_rq; |
1208 | 1215 | ||
1209 | el_ret = elv_merge(q, &req, bio); | 1216 | el_ret = elv_merge(q, &req, bio); |
@@ -1303,7 +1310,7 @@ get_rq: | |||
1303 | 1310 | ||
1304 | /* insert the request into the elevator */ | 1311 | /* insert the request into the elevator */ |
1305 | drive_stat_acct(req, 1); | 1312 | drive_stat_acct(req, 1); |
1306 | __elv_add_request(q, req, ELEVATOR_INSERT_SORT, 0); | 1313 | __elv_add_request(q, req, where, 0); |
1307 | out: | 1314 | out: |
1308 | if (unplug || !queue_should_plug(q)) | 1315 | if (unplug || !queue_should_plug(q)) |
1309 | __generic_unplug_device(q); | 1316 | __generic_unplug_device(q); |