Lines Matching refs:disk

32 	struct cache_set *c = dc->disk.c;  in __calc_target_rate()
84 int64_t dirty = bcache_dev_sectors_dirty(&dc->disk); in __update_writeback_rate()
101 struct cache_set *c = dc->disk.c; in __update_writeback_rate()
247 struct cache_set *c = dc->disk.c; in update_writeback_rate()
253 set_bit(BCACHE_DEV_RATE_DW_RUNNING, &dc->disk.flags); in update_writeback_rate()
261 if (!test_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags) || in update_writeback_rate()
263 clear_bit(BCACHE_DEV_RATE_DW_RUNNING, &dc->disk.flags); in update_writeback_rate()
297 if (test_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags) && in update_writeback_rate()
307 clear_bit(BCACHE_DEV_RATE_DW_RUNNING, &dc->disk.flags); in update_writeback_rate()
315 if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) || in writeback_delay()
372 atomic_inc(&PTR_BUCKET(dc->disk.c, &w->key, i)->pin); in write_dirty_finish()
374 ret = bch_btree_insert(dc->disk.c, &keys, NULL, &w->key); in write_dirty_finish()
380 ? &dc->disk.c->writeback_keys_failed in write_dirty_finish()
381 : &dc->disk.c->writeback_keys_done); in write_dirty_finish()
443 closure_bio_submit(io->dc->disk.c, &io->bio, cl); in write_dirty()
458 bch_count_io_errors(io->dc->disk.c->cache, in read_dirty_endio()
469 closure_bio_submit(io->dc->disk.c, &io->bio, cl); in read_dirty_submit()
496 !test_bit(CACHE_SET_IO_DISABLE, &dc->disk.c->flags) && in read_dirty()
502 BUG_ON(ptr_stale(dc->disk.c, &next->key, 0)); in read_dirty()
552 bio_set_dev(&io->bio, dc->disk.c->cache->bdev); in read_dirty()
573 !test_bit(CACHE_SET_IO_DISABLE, &dc->disk.c->flags) && in read_dirty()
647 BUG_ON(KEY_INODE(k) != dc->disk.id); in dirty_pred()
659 stripe = offset_to_stripe(&dc->disk, KEY_OFFSET(&buf->last_scanned)); in refill_full_stripes()
666 stripe = find_next_bit(dc->disk.full_dirty_stripes, in refill_full_stripes()
667 dc->disk.nr_stripes, stripe); in refill_full_stripes()
669 if (stripe == dc->disk.nr_stripes) in refill_full_stripes()
672 next_stripe = find_next_zero_bit(dc->disk.full_dirty_stripes, in refill_full_stripes()
673 dc->disk.nr_stripes, stripe); in refill_full_stripes()
675 buf->last_scanned = KEY(dc->disk.id, in refill_full_stripes()
676 stripe * dc->disk.stripe_size, 0); in refill_full_stripes()
678 bch_refill_keybuf(dc->disk.c, buf, in refill_full_stripes()
679 &KEY(dc->disk.id, in refill_full_stripes()
680 next_stripe * dc->disk.stripe_size, 0), in refill_full_stripes()
691 if (stripe == dc->disk.nr_stripes) { in refill_full_stripes()
704 struct bkey start = KEY(dc->disk.id, 0, 0); in refill_dirty()
705 struct bkey end = KEY(dc->disk.id, MAX_KEY_OFFSET, 0); in refill_dirty()
724 bch_refill_keybuf(dc->disk.c, buf, &end, dirty_pred); in refill_dirty()
734 bch_refill_keybuf(dc->disk.c, buf, &start_pos, dirty_pred); in refill_dirty()
742 struct cache_set *c = dc->disk.c; in bch_writeback_thread()
758 if (!test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags) && in bch_writeback_thread()
786 if (test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)) { in bch_writeback_thread()
828 !test_bit(BCACHE_DEV_DETACHING, &dc->disk.flags)) in bch_writeback_thread()
1072 WARN_ON(test_and_clear_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags)); in bch_cached_dev_writeback_init()
1093 WARN_ON(test_and_set_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags)); in bch_cached_dev_writeback_start()