diff options
Diffstat (limited to 'block/blk-barrier.c')
-rw-r--r-- | block/blk-barrier.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/block/blk-barrier.c b/block/blk-barrier.c index 20b4111fa050..30022b4e2f63 100644 --- a/block/blk-barrier.c +++ b/block/blk-barrier.c | |||
@@ -106,10 +106,7 @@ bool blk_ordered_complete_seq(struct request_queue *q, unsigned seq, int error) | |||
106 | */ | 106 | */ |
107 | q->ordseq = 0; | 107 | q->ordseq = 0; |
108 | rq = q->orig_bar_rq; | 108 | rq = q->orig_bar_rq; |
109 | 109 | __blk_end_request_all(rq, q->orderr); | |
110 | if (__blk_end_request(rq, q->orderr, blk_rq_bytes(rq))) | ||
111 | BUG(); | ||
112 | |||
113 | return true; | 110 | return true; |
114 | } | 111 | } |
115 | 112 | ||
@@ -166,7 +163,7 @@ static inline bool start_ordered(struct request_queue *q, struct request **rqp) | |||
166 | * For an empty barrier, there's no actual BAR request, which | 163 | * For an empty barrier, there's no actual BAR request, which |
167 | * in turn makes POSTFLUSH unnecessary. Mask them off. | 164 | * in turn makes POSTFLUSH unnecessary. Mask them off. |
168 | */ | 165 | */ |
169 | if (!rq->hard_nr_sectors) { | 166 | if (!blk_rq_sectors(rq)) { |
170 | q->ordered &= ~(QUEUE_ORDERED_DO_BAR | | 167 | q->ordered &= ~(QUEUE_ORDERED_DO_BAR | |
171 | QUEUE_ORDERED_DO_POSTFLUSH); | 168 | QUEUE_ORDERED_DO_POSTFLUSH); |
172 | /* | 169 | /* |
@@ -183,7 +180,7 @@ static inline bool start_ordered(struct request_queue *q, struct request **rqp) | |||
183 | } | 180 | } |
184 | 181 | ||
185 | /* stash away the original request */ | 182 | /* stash away the original request */ |
186 | elv_dequeue_request(q, rq); | 183 | blk_dequeue_request(rq); |
187 | q->orig_bar_rq = rq; | 184 | q->orig_bar_rq = rq; |
188 | rq = NULL; | 185 | rq = NULL; |
189 | 186 | ||
@@ -221,7 +218,7 @@ static inline bool start_ordered(struct request_queue *q, struct request **rqp) | |||
221 | } else | 218 | } else |
222 | skip |= QUEUE_ORDSEQ_PREFLUSH; | 219 | skip |= QUEUE_ORDSEQ_PREFLUSH; |
223 | 220 | ||
224 | if ((q->ordered & QUEUE_ORDERED_BY_DRAIN) && q->in_flight) | 221 | if ((q->ordered & QUEUE_ORDERED_BY_DRAIN) && queue_in_flight(q)) |
225 | rq = NULL; | 222 | rq = NULL; |
226 | else | 223 | else |
227 | skip |= QUEUE_ORDSEQ_DRAIN; | 224 | skip |= QUEUE_ORDSEQ_DRAIN; |
@@ -251,10 +248,8 @@ bool blk_do_ordered(struct request_queue *q, struct request **rqp) | |||
251 | * Queue ordering not supported. Terminate | 248 | * Queue ordering not supported. Terminate |
252 | * with prejudice. | 249 | * with prejudice. |
253 | */ | 250 | */ |
254 | elv_dequeue_request(q, rq); | 251 | blk_dequeue_request(rq); |
255 | if (__blk_end_request(rq, -EOPNOTSUPP, | 252 | __blk_end_request_all(rq, -EOPNOTSUPP); |
256 | blk_rq_bytes(rq))) | ||
257 | BUG(); | ||
258 | *rqp = NULL; | 253 | *rqp = NULL; |
259 | return false; | 254 | return false; |
260 | } | 255 | } |
@@ -329,7 +324,7 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector) | |||
329 | /* | 324 | /* |
330 | * The driver must store the error location in ->bi_sector, if | 325 | * The driver must store the error location in ->bi_sector, if |
331 | * it supports it. For non-stacked drivers, this should be copied | 326 | * it supports it. For non-stacked drivers, this should be copied |
332 | * from rq->sector. | 327 | * from blk_rq_pos(rq). |
333 | */ | 328 | */ |
334 | if (error_sector) | 329 | if (error_sector) |
335 | *error_sector = bio->bi_sector; | 330 | *error_sector = bio->bi_sector; |
@@ -393,10 +388,10 @@ int blkdev_issue_discard(struct block_device *bdev, | |||
393 | 388 | ||
394 | bio->bi_sector = sector; | 389 | bio->bi_sector = sector; |
395 | 390 | ||
396 | if (nr_sects > q->max_hw_sectors) { | 391 | if (nr_sects > queue_max_hw_sectors(q)) { |
397 | bio->bi_size = q->max_hw_sectors << 9; | 392 | bio->bi_size = queue_max_hw_sectors(q) << 9; |
398 | nr_sects -= q->max_hw_sectors; | 393 | nr_sects -= queue_max_hw_sectors(q); |
399 | sector += q->max_hw_sectors; | 394 | sector += queue_max_hw_sectors(q); |
400 | } else { | 395 | } else { |
401 | bio->bi_size = nr_sects << 9; | 396 | bio->bi_size = nr_sects << 9; |
402 | nr_sects = 0; | 397 | nr_sects = 0; |