Lines Matching refs:cblock

612 static void set_dirty(struct cache *cache, dm_cblock_t cblock)  in set_dirty()  argument
614 if (!test_and_set_bit(from_cblock(cblock), cache->dirty_bitset)) { in set_dirty()
616 policy_set_dirty(cache->policy, cblock); in set_dirty()
624 static void force_set_dirty(struct cache *cache, dm_cblock_t cblock) in force_set_dirty() argument
626 if (!test_and_set_bit(from_cblock(cblock), cache->dirty_bitset)) in force_set_dirty()
628 policy_set_dirty(cache->policy, cblock); in force_set_dirty()
631 static void force_clear_dirty(struct cache *cache, dm_cblock_t cblock) in force_clear_dirty() argument
633 if (test_and_clear_bit(from_cblock(cblock), cache->dirty_bitset)) { in force_clear_dirty()
638 policy_clear_dirty(cache->policy, cblock); in force_clear_dirty()
724 dm_cblock_t cblock) in remap_to_cache() argument
727 sector_t block = from_cblock(cblock); in remap_to_cache()
765 dm_oblock_t oblock, dm_cblock_t cblock) in remap_to_cache_dirty() argument
768 remap_to_cache(cache, bio, cblock); in remap_to_cache_dirty()
770 set_dirty(cache, cblock); in remap_to_cache_dirty()
828 dm_oblock_t oblock, dm_cblock_t cblock) in remap_to_origin_and_cache() argument
841 remap_to_cache(cache, bio, cblock); in remap_to_origin_and_cache()
1104 c_region.sector = from_cblock(mg->op->cblock) * cache->sectors_per_block; in copy()
1149 remap_to_cache(mg->cache, bio, mg->op->cblock); in overwrite()
1173 dm_cblock_t cblock = op->cblock; in mg_complete() local
1185 force_set_dirty(cache, cblock); in mg_complete()
1193 force_clear_dirty(cache, cblock); in mg_complete()
1203 force_clear_dirty(cache, cblock); in mg_complete()
1210 force_clear_dirty(cache, cblock); in mg_complete()
1245 r = dm_cache_insert_mapping(cache->cmd, op->cblock, op->oblock); in mg_update_metadata()
1258 r = dm_cache_remove_mapping(cache->cmd, op->cblock); in mg_update_metadata()
1346 if ((!is_policy_promote && !is_dirty(cache, op->cblock)) || in mg_full_copy()
1478 static int invalidate_cblock(struct cache *cache, dm_cblock_t cblock) in invalidate_cblock() argument
1482 r = policy_invalidate_mapping(cache->policy, cblock); in invalidate_cblock()
1484 r = dm_cache_remove_mapping(cache->cmd, cblock); in invalidate_cblock()
1558 static int invalidate_start(struct cache *cache, dm_cblock_t cblock, in invalidate_start() argument
1569 mg->invalidate_cblock = cblock; in invalidate_start()
1617 dm_cblock_t cblock; in map_bio() local
1638 r = policy_lookup_with_work(cache->policy, block, &cblock, data_dir, true, &op); in map_bio()
1653 r = policy_lookup(cache->policy, block, &cblock, data_dir, false, &background_queued); in map_bio()
1697 invalidate_start(cache, cblock, block, bio); in map_bio()
1702 !is_dirty(cache, cblock)) { in map_bio()
1703 remap_to_origin_and_cache(cache, bio, block, cblock); in map_bio()
1706 remap_to_cache_dirty(cache, bio, block, cblock); in map_bio()
2797 static int load_mapping(void *context, dm_oblock_t oblock, dm_cblock_t cblock, in load_mapping() argument
2803 set_bit(from_cblock(cblock), cache->dirty_bitset); in load_mapping()
2806 clear_bit(from_cblock(cblock), cache->dirty_bitset); in load_mapping()
2808 return policy_load_mapping(cache->policy, oblock, cblock, dirty, hint, hint_valid); in load_mapping()