Lines Matching refs:l1_index
227 int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index) in qcow2_write_l1_entry() argument
241 l1_start_index = QEMU_ALIGN_DOWN(l1_index, nentries); in qcow2_write_l1_entry()
273 static int GRAPH_RDLOCK l2_allocate(BlockDriverState *bs, int l1_index) in l2_allocate() argument
282 old_l2_offset = s->l1_table[l1_index]; in l2_allocate()
284 trace_qcow2_l2_allocate(bs, l1_index); in l2_allocate()
315 trace_qcow2_l2_allocate_get_empty(bs, l1_index); in l2_allocate()
348 trace_qcow2_l2_allocate_write_l2(bs, l1_index); in l2_allocate()
359 trace_qcow2_l2_allocate_write_l1(bs, l1_index); in l2_allocate()
360 s->l1_table[l1_index] = l2_offset | QCOW_OFLAG_COPIED; in l2_allocate()
361 ret = qcow2_write_l1_entry(bs, l1_index); in l2_allocate()
366 trace_qcow2_l2_allocate_done(bs, l1_index, 0); in l2_allocate()
370 trace_qcow2_l2_allocate_done(bs, l1_index, ret); in l2_allocate()
374 s->l1_table[l1_index] = old_l2_offset; in l2_allocate()
592 uint64_t l1_index, l2_offset, *l2_slice, l2_entry, l2_bitmap; in qcow2_get_host_offset() local
617 l1_index = offset_to_l1_index(s, offset); in qcow2_get_host_offset()
618 if (l1_index >= s->l1_size) { in qcow2_get_host_offset()
623 l2_offset = s->l1_table[l1_index] & L1E_OFFSET_MASK; in qcow2_get_host_offset()
632 l2_offset, l1_index); in qcow2_get_host_offset()
761 uint64_t l1_index, l2_offset; in get_cluster_table() local
767 l1_index = offset_to_l1_index(s, offset); in get_cluster_table()
768 if (l1_index >= s->l1_size) { in get_cluster_table()
769 ret = qcow2_grow_l1_table(bs, l1_index + 1, false); in get_cluster_table()
775 assert(l1_index < s->l1_size); in get_cluster_table()
776 l2_offset = s->l1_table[l1_index] & L1E_OFFSET_MASK; in get_cluster_table()
780 l2_offset, l1_index); in get_cluster_table()
784 if (!(s->l1_table[l1_index] & QCOW_OFLAG_COPIED)) { in get_cluster_table()
786 ret = l2_allocate(bs, l1_index); in get_cluster_table()
798 l2_offset = s->l1_table[l1_index] & L1E_OFFSET_MASK; in get_cluster_table()
1198 int l1_index = offset_to_l1_index(s, guest_offset); in calculate_l2_meta() local
1199 uint64_t l2_offset = s->l1_table[l1_index] & L1E_OFFSET_MASK; in calculate_l2_meta()