提交 83b5df67 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

bcache: use op_is_sync to check for synchronous requests

(and remove one layer of masking for the op_is_write call next to it).
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 03ea4afa
...@@ -404,8 +404,8 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) ...@@ -404,8 +404,8 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)
if (!congested && if (!congested &&
mode == CACHE_MODE_WRITEBACK && mode == CACHE_MODE_WRITEBACK &&
op_is_write(bio_op(bio)) && op_is_write(bio->bi_opf) &&
(bio->bi_opf & REQ_SYNC)) op_is_sync(bio->bi_opf))
goto rescale; goto rescale;
spin_lock(&dc->io_lock); spin_lock(&dc->io_lock);
......
...@@ -57,8 +57,7 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio, ...@@ -57,8 +57,7 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio,
if (would_skip) if (would_skip)
return false; return false;
return bio->bi_opf & REQ_SYNC || return op_is_sync(bio->bi_opf) || in_use <= CUTOFF_WRITEBACK;
in_use <= CUTOFF_WRITEBACK;
} }
static inline void bch_writeback_queue(struct cached_dev *dc) static inline void bch_writeback_queue(struct cached_dev *dc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册