*/
static int get_cluster_table(BlockDriverState *bs, uint64_t offset,
uint64_t **new_l2_table,
- uint64_t *new_l2_offset,
int *new_l2_index)
{
BDRVQcowState *s = bs->opaque;
l2_index = (offset >> s->cluster_bits) & (s->l2_size - 1);
*new_l2_table = l2_table;
- *new_l2_offset = l2_offset;
*new_l2_index = l2_index;
return 0;
{
BDRVQcowState *s = bs->opaque;
int l2_index, ret;
- uint64_t l2_offset, *l2_table;
+ uint64_t *l2_table;
int64_t cluster_offset;
int nb_csectors;
- ret = get_cluster_table(bs, offset, &l2_table, &l2_offset, &l2_index);
+ ret = get_cluster_table(bs, offset, &l2_table, &l2_index);
if (ret < 0) {
return 0;
}
{
BDRVQcowState *s = bs->opaque;
int i, j = 0, l2_index, ret;
- uint64_t *old_cluster, start_sect, l2_offset, *l2_table;
+ uint64_t *old_cluster, start_sect, *l2_table;
uint64_t cluster_offset = m->alloc_offset;
bool cow = false;
}
qcow2_cache_set_dependency(bs, s->l2_table_cache, s->refcount_block_cache);
- ret = get_cluster_table(bs, m->offset, &l2_table, &l2_offset, &l2_index);
+ ret = get_cluster_table(bs, m->offset, &l2_table, &l2_index);
if (ret < 0) {
goto err;
}
{
BDRVQcowState *s = bs->opaque;
int l2_index, ret, sectors;
- uint64_t l2_offset, *l2_table;
+ uint64_t *l2_table;
unsigned int nb_clusters, keep_clusters;
uint64_t cluster_offset;
n_start, n_end);
/* Find L2 entry for the first involved cluster */
- ret = get_cluster_table(bs, offset, &l2_table, &l2_offset, &l2_index);
+ ret = get_cluster_table(bs, offset, &l2_table, &l2_index);
if (ret < 0) {
return ret;
}
unsigned int nb_clusters)
{
BDRVQcowState *s = bs->opaque;
- uint64_t l2_offset, *l2_table;
+ uint64_t *l2_table;
int l2_index;
int ret;
int i;
- ret = get_cluster_table(bs, offset, &l2_table, &l2_offset, &l2_index);
+ ret = get_cluster_table(bs, offset, &l2_table, &l2_index);
if (ret < 0) {
return ret;
}