提交 1e87901e 编写于 作者: T Tejun Heo 提交者: Jens Axboe

block: filter flush bio's in __generic_make_request()

There are a number of make_request based drivers which don't support
cache flushes.  Filter out flush bio's in __generic_make_request() so
that they don't have to worry about them.  All FLUSH/FUA requests with
data are converted to regular IO requests and empty ones are completed
immediately.
Signed-off-by: NTejun Heo <tj@kernel.org>
Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
上级 4fed947c
...@@ -1509,6 +1509,19 @@ static inline void __generic_make_request(struct bio *bio) ...@@ -1509,6 +1509,19 @@ static inline void __generic_make_request(struct bio *bio)
if (bio_check_eod(bio, nr_sectors)) if (bio_check_eod(bio, nr_sectors))
goto end_io; goto end_io;
/*
* Filter flush bio's early so that make_request based
* drivers without flush support don't have to worry
* about them.
*/
if ((bio->bi_rw & (REQ_FLUSH | REQ_FUA)) && !q->flush_flags) {
bio->bi_rw &= ~(REQ_FLUSH | REQ_FUA);
if (!nr_sectors) {
err = 0;
goto end_io;
}
}
if ((bio->bi_rw & REQ_DISCARD) && if ((bio->bi_rw & REQ_DISCARD) &&
(!blk_queue_discard(q) || (!blk_queue_discard(q) ||
((bio->bi_rw & REQ_SECURE) && ((bio->bi_rw & REQ_SECURE) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册