diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-22 17:35:56 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-28 18:12:46 -0400 |
commit | 8aa6e6e10ce712bcb10be9a206ec13d00ad0e7e6 (patch) | |
tree | 347feb718da57de42ae6f2e5367df3e2e5ad6466 /drivers/md/bcache/io.c | |
parent | 7b42d65c0607af212b9ef3aa834ea449e3f846b1 (diff) |
Initial bcache/bcachefs integrationbcache2
Diffstat (limited to 'drivers/md/bcache/io.c')
-rw-r--r-- | drivers/md/bcache/io.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c index 8ba675b8a2da..90758649eb11 100644 --- a/drivers/md/bcache/io.c +++ b/drivers/md/bcache/io.c @@ -59,25 +59,17 @@ static struct hlist_head *iohash(struct cached_dev *dc, uint64_t k) return &dc->io_hash[hash_64(k, RECENT_IO_BITS)]; } -bool bch_check_should_bypass(struct cached_dev *dc, struct bio *bio) +bool bch_check_should_bypass(struct cached_dev *dc, struct bio *bio, + unsigned int block_size, + unsigned int in_use) { unsigned int mode = cache_mode(dc); - unsigned int sectors, congested, dirty_percentage, block_size; + unsigned int sectors, congested; struct task_struct *task = current; struct io *i; - if (dc->disk.c) { - dirty_percentage = dc->disk.c->gc_stats.in_use; - block_size = dc->disk.c->sb.block_size; - } else { - /* XXX bcache2: */ - dirty_percentage = 0; - block_size = 0; - //block_size = dc->disk.c2->sb.block_size; - } - if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || - dirty_percentage > CUTOFF_CACHE_ADD || + in_use > CUTOFF_CACHE_ADD || (bio_op(bio) == REQ_OP_DISCARD)) goto skip; |