diff options
author | Eric Wheeler <bcache@linux.ewheeler.net> | 2017-10-14 02:35:33 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-10-16 18:07:26 +0300 |
commit | b41c9b0266e8370033a7799f6806bfc70b7fd75f (patch) | |
tree | 0c2aa53a2c267290dae162b6573ab0f74d73194d /drivers/md/bcache/writeback.h | |
parent | e89d67596e202119ea846cc997f4cf75cb284490 (diff) | |
download | linux-b41c9b0266e8370033a7799f6806bfc70b7fd75f.tar.xz |
bcache: update bio->bi_opf bypass/writeback REQ_ flag hints
Flag for bypass if the IO is for read-ahead or background, unless the
read-ahead request is for metadata (eg, from gfs2).
Bypass if:
bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) &&
!(bio->bi_opf & REQ_META))
Writeback if:
op_is_sync(bio->bi_opf) ||
bio->bi_opf & (REQ_META|REQ_PRIO)
Signed-off-by: Eric Wheeler <bcache@linux.ewheeler.net>
Reviewed-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/writeback.h')
-rw-r--r-- | drivers/md/bcache/writeback.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/bcache/writeback.h b/drivers/md/bcache/writeback.h index e35421d20d2e..34bcf49d737b 100644 --- a/drivers/md/bcache/writeback.h +++ b/drivers/md/bcache/writeback.h @@ -76,7 +76,9 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio, if (would_skip) return false; - return op_is_sync(bio->bi_opf) || in_use <= CUTOFF_WRITEBACK; + return (op_is_sync(bio->bi_opf) || + bio->bi_opf & (REQ_META|REQ_PRIO) || + in_use <= CUTOFF_WRITEBACK); } static inline void bch_writeback_queue(struct cached_dev *dc) |