from_cblock
if (from_cblock(new_cache_size) < from_cblock(cmd->cache_blocks)) {
r = dm_array_resize(&cmd->info, cmd->root, from_cblock(cmd->cache_blocks),
from_cblock(new_cache_size),
from_cblock(cmd->cache_blocks), from_cblock(new_cache_size),
r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock),
r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock),
(unsigned long long) from_cblock(to_cblock(cb)));
(unsigned long long) from_cblock(to_cblock(cb)));
if (from_cblock(cmd->cache_blocks) == 0)
from_cblock(cmd->cache_blocks),
if (cb >= (from_cblock(cmd->cache_blocks) - 1))
r = dm_array_get_value(&cmd->info, cmd->root, from_cblock(cblock), &value);
r = dm_array_set_value(&cmd->info, cmd->root, from_cblock(cblock),
if (nr_bits != from_cblock(cmd->cache_blocks)) {
from_cblock(cmd->cache_blocks),
disk_super->cache_blocks = cpu_to_le32(from_cblock(cmd->cache_blocks));
r = dm_array_get_value(&cmd->info, cmd->root, from_cblock(b), &value);
(unsigned long long) from_cblock(begin));
begin = to_cblock(from_cblock(begin) + 1);
if (from_cblock(cmd->cache_blocks) == 0)
from_cblock(cmd->cache_blocks), &cmd->dirty_cursor);
r = dm_bitset_cursor_skip(&cmd->dirty_cursor, from_cblock(begin));
(unsigned long long) from_cblock(begin));
begin = to_cblock(from_cblock(begin) + 1);
if (!test_and_set_bit(from_cblock(infer_cblock(mq, e)), mq->cache_hit_bits)) {
clear_bitset(mq->cache_hit_bits, from_cblock(mq->cache_size));
return from_cblock(mq->cache_size) * p / 100u;
nr_free = from_cblock(mq->cache_size) - mq->cache_alloc.nr_allocated;
from_cblock(work->cblock));
struct entry *e = get_entry(&mq->cache_alloc, from_cblock(cblock));
return hash_32(from_cblock(cblock), 9) & (NR_CACHE_LEVELS - 1);
e = alloc_particular_entry(&mq->cache_alloc, from_cblock(cblock));
struct entry *e = get_entry(&mq->cache_alloc, from_cblock(cblock));
struct entry *e = get_entry(&mq->cache_alloc, from_cblock(cblock));
calc_hotspot_params(origin_size, cache_block_size, from_cblock(cache_size),
if (space_init(&mq->es, total_sentinels + mq->nr_hotspot_blocks + from_cblock(cache_size))) {
total_sentinels + mq->nr_hotspot_blocks + from_cblock(cache_size));
if (from_cblock(cache_size)) {
mq->cache_hit_bits = alloc_bitset(from_cblock(cache_size));
clear_bitset(mq->cache_hit_bits, from_cblock(mq->cache_size));
from_cblock(mq->cache_size) / mq->cache_blocks_per_hotspot_block);
if (h_init(&mq->table, &mq->es, from_cblock(cache_size)))
c_region.sector = from_cblock(mg->op->cblock) * cache->sectors_per_block;
dm_block_t nr_blocks = from_cblock(size);
cache->dirty_bitset = alloc_bitset(from_cblock(cache->cache_size));
clear_bitset(cache->dirty_bitset, from_cblock(cache->cache_size));
cache->invalid_bitset = alloc_bitset(from_cblock(cache->cache_size));
clear_bitset(cache->invalid_bitset, from_cblock(cache->cache_size));
r = dm_cache_set_dirty_bits(cache->cmd, from_cblock(cache->cache_size), cache->dirty_bitset);
set_bit(from_cblock(cblock), cache->dirty_bitset);
clear_bit(from_cblock(cblock), cache->dirty_bitset);
cache_device_name(cache), from_cblock(cblock));
set_bit(from_cblock(cblock), cache->invalid_bitset);
if (from_cblock(new_size) > from_cblock(cache->cache_size)) {
from_cblock(cache->cache_size),
from_cblock(new_size)));
(unsigned long long) from_cblock(new_size));
uint32_t nr_blocks = from_cblock(cache->cache_size);
clear_bitset(cache->invalid_bitset, from_cblock(cache->cache_size));
(unsigned long long) from_cblock(residency),
(unsigned long long) from_cblock(cache->cache_size),
result->end = to_cblock(from_cblock(result->begin) + 1u);
uint64_t b = from_cblock(range->begin);
uint64_t e = from_cblock(range->end);
uint64_t n = from_cblock(cache->cache_size);
return to_cblock(from_cblock(b) + 1);
return test_bit(from_cblock(b), cache->dirty_bitset);
if (!test_and_set_bit(from_cblock(cblock), cache->dirty_bitset)) {
if (!test_and_set_bit(from_cblock(cblock), cache->dirty_bitset))
if (test_and_clear_bit(from_cblock(cblock), cache->dirty_bitset)) {
sector_t block = from_cblock(cblock);