Lines Matching refs:l1_index

226 int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index)  in qcow2_write_l1_entry()  argument
233 l1_start_index = l1_index & ~(L1_ENTRIES_PER_SECTOR - 1); in qcow2_write_l1_entry()
267 static int l2_allocate(BlockDriverState *bs, int l1_index) in l2_allocate() argument
276 old_l2_offset = s->l1_table[l1_index]; in l2_allocate()
278 trace_qcow2_l2_allocate(bs, l1_index); in l2_allocate()
306 trace_qcow2_l2_allocate_get_empty(bs, l1_index); in l2_allocate()
339 trace_qcow2_l2_allocate_write_l2(bs, l1_index); in l2_allocate()
350 trace_qcow2_l2_allocate_write_l1(bs, l1_index); in l2_allocate()
351 s->l1_table[l1_index] = l2_offset | QCOW_OFLAG_COPIED; in l2_allocate()
352 ret = qcow2_write_l1_entry(bs, l1_index); in l2_allocate()
357 trace_qcow2_l2_allocate_done(bs, l1_index, 0); in l2_allocate()
361 trace_qcow2_l2_allocate_done(bs, l1_index, ret); in l2_allocate()
365 s->l1_table[l1_index] = old_l2_offset; in l2_allocate()
533 uint64_t l1_index, l2_offset, *l2_slice; in qcow2_get_cluster_offset() local
558 l1_index = offset_to_l1_index(s, offset); in qcow2_get_cluster_offset()
559 if (l1_index >= s->l1_size) { in qcow2_get_cluster_offset()
564 l2_offset = s->l1_table[l1_index] & L1E_OFFSET_MASK; in qcow2_get_cluster_offset()
573 l2_offset, l1_index); in qcow2_get_cluster_offset()
675 uint64_t l1_index, l2_offset; in get_cluster_table() local
681 l1_index = offset_to_l1_index(s, offset); in get_cluster_table()
682 if (l1_index >= s->l1_size) { in get_cluster_table()
683 ret = qcow2_grow_l1_table(bs, l1_index + 1, false); in get_cluster_table()
689 assert(l1_index < s->l1_size); in get_cluster_table()
690 l2_offset = s->l1_table[l1_index] & L1E_OFFSET_MASK; in get_cluster_table()
694 l2_offset, l1_index); in get_cluster_table()
698 if (!(s->l1_table[l1_index] & QCOW_OFLAG_COPIED)) { in get_cluster_table()
700 ret = l2_allocate(bs, l1_index); in get_cluster_table()
712 l2_offset = s->l1_table[l1_index] & L1E_OFFSET_MASK; in get_cluster_table()