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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index a824e49c0d0a..9e2e86fb78b8 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1125,6 +1125,8 @@ void init_request_from_bio(struct request *req, struct bio *bio)
1125 1125
1126 if (bio_sync(bio)) 1126 if (bio_sync(bio))
1127 req->cmd_flags |= REQ_RW_SYNC; 1127 req->cmd_flags |= REQ_RW_SYNC;
1128 if (bio_unplug(bio))
1129 req->cmd_flags |= REQ_UNPLUG;
1128 if (bio_rw_meta(bio)) 1130 if (bio_rw_meta(bio))
1129 req->cmd_flags |= REQ_RW_META; 1131 req->cmd_flags |= REQ_RW_META;
1130 1132
@@ -1141,6 +1143,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
1141 int el_ret, nr_sectors; 1143 int el_ret, nr_sectors;
1142 const unsigned short prio = bio_prio(bio); 1144 const unsigned short prio = bio_prio(bio);
1143 const int sync = bio_sync(bio); 1145 const int sync = bio_sync(bio);
1146 const int unplug = bio_unplug(bio);
1144 int rw_flags; 1147 int rw_flags;
1145 1148
1146 nr_sectors = bio_sectors(bio); 1149 nr_sectors = bio_sectors(bio);
@@ -1244,7 +1247,7 @@ get_rq:
1244 blk_plug_device(q); 1247 blk_plug_device(q);
1245 add_request(q, req); 1248 add_request(q, req);
1246out: 1249out:
1247 if (sync || blk_queue_nonrot(q)) 1250 if (unplug || blk_queue_nonrot(q))
1248 __generic_unplug_device(q); 1251 __generic_unplug_device(q);
1249 spin_unlock_irq(q->queue_lock); 1252 spin_unlock_irq(q->queue_lock);
1250 return 0; 1253 return 0;