Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83b5df67 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 03ea4afa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −2
Original line number Diff line number Diff line
@@ -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)