aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-barrier.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-barrier.c')
-rw-r--r--block/blk-barrier.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/block/blk-barrier.c b/block/blk-barrier.c
index 55c5f1fc4f1f..66e55288178c 100644
--- a/block/blk-barrier.c
+++ b/block/blk-barrier.c
@@ -53,7 +53,7 @@ EXPORT_SYMBOL(blk_queue_ordered);
53/* 53/*
54 * Cache flushing for ordered writes handling 54 * Cache flushing for ordered writes handling
55 */ 55 */
56inline unsigned blk_ordered_cur_seq(struct request_queue *q) 56unsigned blk_ordered_cur_seq(struct request_queue *q)
57{ 57{
58 if (!q->ordseq) 58 if (!q->ordseq)
59 return 0; 59 return 0;
@@ -143,10 +143,8 @@ static void queue_flush(struct request_queue *q, unsigned which)
143 end_io = post_flush_end_io; 143 end_io = post_flush_end_io;
144 } 144 }
145 145
146 blk_rq_init(q, rq);
146 rq->cmd_flags = REQ_HARDBARRIER; 147 rq->cmd_flags = REQ_HARDBARRIER;
147 rq_init(q, rq);
148 rq->elevator_private = NULL;
149 rq->elevator_private2 = NULL;
150 rq->rq_disk = q->bar_rq.rq_disk; 148 rq->rq_disk = q->bar_rq.rq_disk;
151 rq->end_io = end_io; 149 rq->end_io = end_io;
152 q->prepare_flush_fn(q, rq); 150 q->prepare_flush_fn(q, rq);
@@ -167,14 +165,11 @@ static inline struct request *start_ordered(struct request_queue *q,
167 blkdev_dequeue_request(rq); 165 blkdev_dequeue_request(rq);
168 q->orig_bar_rq = rq; 166 q->orig_bar_rq = rq;
169 rq = &q->bar_rq; 167 rq = &q->bar_rq;
170 rq->cmd_flags = 0; 168 blk_rq_init(q, rq);
171 rq_init(q, rq);
172 if (bio_data_dir(q->orig_bar_rq->bio) == WRITE) 169 if (bio_data_dir(q->orig_bar_rq->bio) == WRITE)
173 rq->cmd_flags |= REQ_RW; 170 rq->cmd_flags |= REQ_RW;
174 if (q->ordered & QUEUE_ORDERED_FUA) 171 if (q->ordered & QUEUE_ORDERED_FUA)
175 rq->cmd_flags |= REQ_FUA; 172 rq->cmd_flags |= REQ_FUA;
176 rq->elevator_private = NULL;
177 rq->elevator_private2 = NULL;
178 init_request_from_bio(rq, q->orig_bar_rq->bio); 173 init_request_from_bio(rq, q->orig_bar_rq->bio);
179 rq->end_io = bar_end_io; 174 rq->end_io = bar_end_io;
180 175