Home | History | Annotate | Download | only in block

Lines Matching refs:l2_offset

123  * seek l2_offset in the l2_cache table
132 static uint64_t *seek_l2_table(BDRVQcowState *s, uint64_t l2_offset)
137 if (l2_offset == s->l2_cache_offsets[i]) {
160 static int l2_load(BlockDriverState *bs, uint64_t l2_offset,
169 *l2_table = seek_l2_table(s, l2_offset);
180 ret = bdrv_pread(bs->file, l2_offset, *l2_table,
186 s->l2_cache_offsets[min_index] = l2_offset;
235 int64_t l2_offset;
242 l2_offset = qcow2_alloc_clusters(bs, s->l2_size * sizeof(uint64_t));
243 if (l2_offset < 0) {
244 return l2_offset;
266 ret = bdrv_pwrite_sync(bs->file, l2_offset, l2_table,
273 s->l1_table[l1_index] = l2_offset | QCOW_OFLAG_COPIED;
281 s->l2_cache_offsets[min_index] = l2_offset;
445 uint64_t l2_offset, *l2_table;
478 l2_offset = s->l1_table[l1_index];
482 if (!l2_offset)
487 l2_offset &= ~QCOW_OFLAG_COPIED;
488 ret = l2_load(bs, l2_offset, &l2_table);
537 uint64_t l2_offset;
550 l2_offset = s->l1_table[l1_index];
554 if (l2_offset & QCOW_OFLAG_COPIED) {
556 l2_offset &= ~QCOW_OFLAG_COPIED;
557 ret = l2_load(bs, l2_offset, &l2_table);
562 if (l2_offset)
563 qcow2_free_clusters(bs, l2_offset
568 l2_offset = s->l1_table[l1_index] & ~QCOW_OFLAG_COPIED;
576 *new_l2_offset = l2_offset;
601 uint64_t l2_offset, *l2_table;
605 ret = get_cluster_table(bs, offset, &l2_table, &l2_offset, &l2_index);
635 l2_offset + l2_index * sizeof(uint64_t),
649 uint64_t l2_offset, int l2_index, int num)
658 ret = bdrv_pwrite_sync(bs->file, l2_offset + start_offset,
671 uint64_t *old_cluster, start_sect, l2_offset, *l2_table;
696 ret = get_cluster_table(bs, m->offset, &l2_table, &l2_offset, &l2_index);
715 ret = write_l2_entries(bs, l2_table, l2_offset, l2_index, m->nb_clusters);
755 uint64_t l2_offset, *l2_table;
760 ret = get_cluster_table(bs, offset, &l2_table, &l2_offset, &l2_index);