Commit b6a903151d05e3912ab66b186f74c61851efb88c
Committed by
Jens Axboe
1 parent
8749534fe6
Exists in
master
and in
7 other branches
block: permit PREFLUSH and POSTFLUSH without prepare_flush_fn
This is preparation for removing q->prepare_flush_fn. Temporarily, blk_queue_ordered() permits QUEUE_ORDERED_DO_PREFLUSH and QUEUE_ORDERED_DO_POSTFLUSH without prepare_flush_fn. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Showing 1 changed file with 2 additions and 7 deletions Side-by-side Diff
block/blk-barrier.c
... | ... | @@ -25,12 +25,6 @@ |
25 | 25 | int blk_queue_ordered(struct request_queue *q, unsigned ordered, |
26 | 26 | prepare_flush_fn *prepare_flush_fn) |
27 | 27 | { |
28 | - if (!prepare_flush_fn && (ordered & (QUEUE_ORDERED_DO_PREFLUSH | | |
29 | - QUEUE_ORDERED_DO_POSTFLUSH))) { | |
30 | - printk(KERN_ERR "%s: prepare_flush_fn required\n", __func__); | |
31 | - return -EINVAL; | |
32 | - } | |
33 | - | |
34 | 28 | if (ordered != QUEUE_ORDERED_NONE && |
35 | 29 | ordered != QUEUE_ORDERED_DRAIN && |
36 | 30 | ordered != QUEUE_ORDERED_DRAIN_FLUSH && |
... | ... | @@ -146,7 +140,8 @@ |
146 | 140 | rq->cmd_flags = REQ_HARDBARRIER | REQ_FLUSH; |
147 | 141 | rq->rq_disk = q->bar_rq.rq_disk; |
148 | 142 | rq->end_io = end_io; |
149 | - q->prepare_flush_fn(q, rq); | |
143 | + if (q->prepare_flush_fn) | |
144 | + q->prepare_flush_fn(q, rq); | |
150 | 145 | |
151 | 146 | elv_insert(q, rq, ELEVATOR_INSERT_FRONT); |
152 | 147 | } |