* hash device after the hash blocks.
*/
- hash_blocks = v->hash_blocks - v->hash_start;
+ hash_blocks = v->hash_end - v->hash_start;
/*
* Require matching block sizes for data and hash devices for
hash_block_start &= ~(sector_t)(cluster - 1);
hash_block_end |= cluster - 1;
- if (unlikely(hash_block_end >= v->hash_blocks))
- hash_block_end = v->hash_blocks - 1;
+ if (unlikely(hash_block_end >= v->hash_end))
+ hash_block_end = v->hash_end - 1;
}
no_prefetch_cluster:
dm_bufio_prefetch_with_ioprio(v->bufio, hash_block_start,
}
hash_position += s;
}
- v->hash_blocks = hash_position;
+ v->hash_end = hash_position;
r = mempool_init_page_pool(&v->recheck_pool, 1, 0);
if (unlikely(r)) {
goto bad;
}
- if (dm_bufio_get_device_size(v->bufio) < v->hash_blocks) {
+ if (dm_bufio_get_device_size(v->bufio) < v->hash_end) {
ti->error = "Hash device is too small";
r = -E2BIG;
goto bad;
unsigned int sig_size; /* root digest signature size */
#endif /* CONFIG_SECURITY */
unsigned int salt_size;
- sector_t hash_start; /* hash start in blocks */
+ sector_t hash_start; /* index of first hash block on hash_dev */
+ sector_t hash_end; /* 1 + index of last hash block on hash dev */
sector_t data_blocks; /* the number of data blocks */
- sector_t hash_blocks; /* the number of hash blocks */
unsigned char data_dev_block_bits; /* log2(data blocksize) */
unsigned char hash_dev_block_bits; /* log2(hash blocksize) */
unsigned char hash_per_block_bits; /* log2(hashes in hash block) */