Lines Matching refs:l1_index
197 static int write_l1_entry(BlockDriverState *bs, int l1_index)
204 l1_start_index = l1_index & ~(L1_ENTRIES_PER_SECTOR - 1);
222 * Allocate a new l2 entry in the file. If l1_index points to an already
229 static int l2_allocate(BlockDriverState *bs, int l1_index, uint64_t **table)
238 old_l2_offset = s->l1_table[l1_index];
273 s->l1_table[l1_index] = l2_offset | QCOW_OFLAG_COPIED;
274 ret = write_l1_entry(bs, l1_index);
288 s->l1_table[l1_index] = old_l2_offset;
444 unsigned int l1_index, l2_index;
474 l1_index = offset >> l1_bits;
475 if (l1_index >= s->l1_size)
478 l2_offset = s->l1_table[l1_index];
536 unsigned int l1_index, l2_index;
543 l1_index = offset >> (s->l2_bits + s->cluster_bits);
544 if (l1_index >= s->l1_size) {
545 ret = qcow2_grow_l1_table(bs, l1_index + 1);
550 l2_offset = s->l1_table[l1_index];
564 ret = l2_allocate(bs, l1_index, &l2_table);
568 l2_offset = s->l1_table[l1_index] & ~QCOW_OFLAG_COPIED;