Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123290
b: refs/heads/master
c: 58eea92
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Dec 29, 2008
1 parent 2fdb69d commit c4d2a3e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f11b3e99a1136fcbb67316c3260f085299c0bff
refs/heads/master: 58eea927d2de43dc6f03d1ba2c46e55854b31540
16 changes: 10 additions & 6 deletions trunk/block/blk-barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ static inline bool start_ordered(struct request_queue *q, struct request **rqp)
q->ordered = q->next_ordered;
q->ordseq |= QUEUE_ORDSEQ_STARTED;

/*
* For an empty barrier, there's no actual BAR request, which
* in turn makes POSTFLUSH unnecessary. Mask them off.
*/
if (!rq->hard_nr_sectors)
q->ordered &= ~(QUEUE_ORDERED_DO_BAR |
QUEUE_ORDERED_DO_POSTFLUSH);

/* stash away the original request */
elv_dequeue_request(q, rq);
q->orig_bar_rq = rq;
Expand All @@ -171,13 +179,9 @@ static inline bool start_ordered(struct request_queue *q, struct request **rqp)
* Queue ordered sequence. As we stack them at the head, we
* need to queue in reverse order. Note that we rely on that
* no fs request uses ELEVATOR_INSERT_FRONT and thus no fs
* request gets inbetween ordered sequence. If this request is
* an empty barrier, we don't need to do a postflush ever since
* there will be no data written between the pre and post flush.
* Hence a single flush will suffice.
* request gets inbetween ordered sequence.
*/
if ((q->ordered & QUEUE_ORDERED_DO_POSTFLUSH) &&
!blk_empty_barrier(q->orig_bar_rq)) {
if (q->ordered & QUEUE_ORDERED_DO_POSTFLUSH) {
queue_flush(q, QUEUE_ORDERED_DO_POSTFLUSH);
rq = &q->post_flush_rq;
} else
Expand Down
8 changes: 0 additions & 8 deletions trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,14 +755,6 @@ struct request *elv_next_request(struct request_queue *q)
int ret;

while ((rq = __elv_next_request(q)) != NULL) {
/*
* Kill the empty barrier place holder, the driver must
* not ever see it.
*/
if (blk_empty_barrier(rq)) {
__blk_end_request(rq, 0, blk_rq_bytes(rq));
continue;
}
if (!(rq->cmd_flags & REQ_STARTED)) {
/*
* This is the first time the device driver
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ enum {
#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
#define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD)
#define blk_bidi_rq(rq) ((rq)->next_rq != NULL)
#define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors)
/* rq->queuelist of dequeued request must be list_empty() */
#define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist))

Expand Down

0 comments on commit c4d2a3e

Please sign in to comment.