Skip to content

Commit

Permalink
bcache: use op_is_sync to check for synchronous requests
Browse files Browse the repository at this point in the history
(and remove one layer of masking for the op_is_write call next to it).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Nov 1, 2016
1 parent 03ea4af commit 83b5df6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/md/bcache/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ static bool check_should_bypass(struct cached_dev *dc, struct bio *bio)

if (!congested &&
mode == CACHE_MODE_WRITEBACK &&
op_is_write(bio_op(bio)) &&
(bio->bi_opf & REQ_SYNC))
op_is_write(bio->bi_opf) &&
op_is_sync(bio->bi_opf))
goto rescale;

spin_lock(&dc->io_lock);
Expand Down
3 changes: 1 addition & 2 deletions drivers/md/bcache/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ static inline bool should_writeback(struct cached_dev *dc, struct bio *bio,
if (would_skip)
return false;

return bio->bi_opf & REQ_SYNC ||
in_use <= CUTOFF_WRITEBACK;
return op_is_sync(bio->bi_opf) || in_use <= CUTOFF_WRITEBACK;
}

static inline void bch_writeback_queue(struct cached_dev *dc)
Expand Down

0 comments on commit 83b5df6

Please sign in to comment.