diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2010-07-03 04:45:32 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:23:53 -0400 |
commit | 8749534fe6826596b71bc409c872b047a8e2755b (patch) | |
tree | 29ceb928f03dfb33d3a03df1c00e4a51d22b55b3 /block/blk-barrier.c | |
parent | 802447c1c0513a0ea0e29d6bda23b19ac0686654 (diff) |
block: introduce REQ_FLUSH flag
SCSI-ml needs a way to mark a request as flush request in
q->prepare_flush_fn because it needs to identify them later (e.g. in
q->request_fn or prep_rq_fn).
queue_flush sets REQ_HARDBARRIER in rq->cmd_flags however the block
layer also sends normal REQ_TYPE_FS requests with REQ_HARDBARRIER. So
SCSI-ml can't use REQ_HARDBARRIER to identify flush requests.
We could change the block layer to clear REQ_HARDBARRIER bit before
sending non flush requests to the lower layers. However, intorudcing
the new flag looks cleaner (surely easier).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@suse.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Alasdair G Kergon <agk@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-barrier.c')
-rw-r--r-- | block/blk-barrier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-barrier.c b/block/blk-barrier.c index 7c6f4a714687..a3482425c507 100644 --- a/block/blk-barrier.c +++ b/block/blk-barrier.c | |||
@@ -143,7 +143,7 @@ static void queue_flush(struct request_queue *q, unsigned which) | |||
143 | } | 143 | } |
144 | 144 | ||
145 | blk_rq_init(q, rq); | 145 | blk_rq_init(q, rq); |
146 | rq->cmd_flags = REQ_HARDBARRIER; | 146 | rq->cmd_flags = REQ_HARDBARRIER | REQ_FLUSH; |
147 | rq->rq_disk = q->bar_rq.rq_disk; | 147 | rq->rq_disk = q->bar_rq.rq_disk; |
148 | rq->end_io = end_io; | 148 | rq->end_io = end_io; |
149 | q->prepare_flush_fn(q, rq); | 149 | q->prepare_flush_fn(q, rq); |