diff options
author | Eric Wheeler <bcache@linux.ewheeler.net> | 2017-10-13 19:35:33 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-10-16 11:07:26 -0400 |
commit | b41c9b0266e8370033a7799f6806bfc70b7fd75f (patch) | |
tree | 0c2aa53a2c267290dae162b6573ab0f74d73194d /drivers/md/bcache/request.c | |
parent | e89d67596e202119ea846cc997f4cf75cb284490 (diff) |
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/request.c')
-rw-r--r-- | drivers/md/bcache/request.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 681b4f12b05a..9ee137e8d387 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
@@ -384,6 +384,14 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio) | |||
384 | op_is_write(bio_op(bio)))) | 384 | op_is_write(bio_op(bio)))) |
385 | goto skip; | 385 | goto skip; |
386 | 386 | ||
387 | /* | ||
388 | * Flag for bypass if the IO is for read-ahead or background, | ||
389 | * unless the read-ahead request is for metadata (eg, for gfs2). | ||
390 | */ | ||
391 | if (bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) && | ||
392 | !(bio->bi_opf & REQ_META)) | ||
393 | goto skip; | ||
394 | |||
387 | if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) || | 395 | if (bio->bi_iter.bi_sector & (c->sb.block_size - 1) || |
388 | bio_sectors(bio) & (c->sb.block_size - 1)) { | 396 | bio_sectors(bio) & (c->sb.block_size - 1)) { |
389 | pr_debug("skipping unaligned io"); | 397 | pr_debug("skipping unaligned io"); |