Lines Matching refs:l2_slice

212         uint64_t l2_offset, uint64_t **l2_slice)  in l2_load()  argument
219 (void **)l2_slice); in l2_load()
277 uint64_t *l2_slice = NULL; in l2_allocate() local
319 (void **) &l2_slice); in l2_allocate()
326 memset(l2_slice, 0, slice_size2); in l2_allocate()
340 memcpy(l2_slice, old_slice, slice_size2); in l2_allocate()
349 qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice); in l2_allocate()
350 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in l2_allocate()
371 if (l2_slice != NULL) { in l2_allocate()
372 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in l2_allocate()
446 unsigned sc_index, uint64_t *l2_slice, in count_contiguous_subclusters() argument
459 uint64_t l2_entry = get_l2_entry(s, l2_slice, *l2_index + i); in count_contiguous_subclusters()
460 uint64_t l2_bitmap = get_l2_bitmap(s, l2_slice, *l2_index + i); in count_contiguous_subclusters()
592 uint64_t l1_index, l2_offset, *l2_slice, l2_entry, l2_bitmap; in qcow2_get_host_offset() local
638 ret = l2_load(bs, offset, l2_offset, &l2_slice); in qcow2_get_host_offset()
647 l2_entry = get_l2_entry(s, l2_slice, l2_index); in qcow2_get_host_offset()
648 l2_bitmap = get_l2_bitmap(s, l2_slice, l2_index); in qcow2_get_host_offset()
713 l2_slice, &l2_index); in qcow2_get_host_offset()
721 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in qcow2_get_host_offset()
741 qcow2_cache_put(s->l2_table_cache, (void **)&l2_slice); in qcow2_get_host_offset()
762 uint64_t *l2_slice = NULL; in get_cluster_table() local
803 ret = l2_load(bs, offset, l2_offset, &l2_slice); in get_cluster_table()
812 *new_l2_slice = l2_slice; in get_cluster_table()
833 uint64_t *l2_slice; in qcow2_alloc_compressed_cluster_offset() local
841 ret = get_cluster_table(bs, offset, &l2_slice, &l2_index); in qcow2_alloc_compressed_cluster_offset()
848 cluster_offset = get_l2_entry(s, l2_slice, l2_index); in qcow2_alloc_compressed_cluster_offset()
850 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in qcow2_alloc_compressed_cluster_offset()
856 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in qcow2_alloc_compressed_cluster_offset()
876 qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice); in qcow2_alloc_compressed_cluster_offset()
877 set_l2_entry(s, l2_slice, l2_index, cluster_offset); in qcow2_alloc_compressed_cluster_offset()
879 set_l2_bitmap(s, l2_slice, l2_index, 0); in qcow2_alloc_compressed_cluster_offset()
881 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in qcow2_alloc_compressed_cluster_offset()
1033 uint64_t *old_cluster, *l2_slice; in qcow2_alloc_cluster_link_l2() local
1060 ret = get_cluster_table(bs, m->offset, &l2_slice, &l2_index); in qcow2_alloc_cluster_link_l2()
1064 qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice); in qcow2_alloc_cluster_link_l2()
1077 if (get_l2_entry(s, l2_slice, l2_index + i) != 0) { in qcow2_alloc_cluster_link_l2()
1078 old_cluster[j++] = get_l2_entry(s, l2_slice, l2_index + i); in qcow2_alloc_cluster_link_l2()
1084 set_l2_entry(s, l2_slice, l2_index + i, offset | QCOW_OFLAG_COPIED); in qcow2_alloc_cluster_link_l2()
1088 uint64_t l2_bitmap = get_l2_bitmap(s, l2_slice, l2_index + i); in qcow2_alloc_cluster_link_l2()
1100 set_l2_bitmap(s, l2_slice, l2_index + i, l2_bitmap); in qcow2_alloc_cluster_link_l2()
1105 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in qcow2_alloc_cluster_link_l2()
1161 uint64_t guest_offset, unsigned bytes, uint64_t *l2_slice, in calculate_l2_meta() argument
1180 l2_entry = get_l2_entry(s, l2_slice, l2_index + i); in calculate_l2_meta()
1181 l2_bitmap = get_l2_bitmap(s, l2_slice, l2_index + i); in calculate_l2_meta()
1213 l2_entry = get_l2_entry(s, l2_slice, l2_index); in calculate_l2_meta()
1214 l2_bitmap = get_l2_bitmap(s, l2_slice, l2_index); in calculate_l2_meta()
1258 l2_entry = get_l2_entry(s, l2_slice, l2_index); in calculate_l2_meta()
1259 l2_bitmap = get_l2_bitmap(s, l2_slice, l2_index); in calculate_l2_meta()
1366 uint64_t *l2_slice, int l2_index, bool new_alloc) in count_single_write_clusters() argument
1369 uint64_t l2_entry = get_l2_entry(s, l2_slice, l2_index); in count_single_write_clusters()
1374 l2_entry = get_l2_entry(s, l2_slice, l2_index + i); in count_single_write_clusters()
1501 uint64_t *l2_slice; in handle_copied() local
1525 ret = get_cluster_table(bs, guest_offset, &l2_slice, &l2_index); in handle_copied()
1530 l2_entry = get_l2_entry(s, l2_slice, l2_index); in handle_copied()
1552 keep_clusters = count_single_write_clusters(bs, nb_clusters, l2_slice, in handle_copied()
1562 *bytes, l2_slice, m, true); in handle_copied()
1574 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in handle_copied()
1667 uint64_t *l2_slice; in handle_alloc() local
1690 ret = get_cluster_table(bs, guest_offset, &l2_slice, &l2_index); in handle_alloc()
1696 l2_slice, l2_index, true); in handle_alloc()
1744 l2_slice, m, false); in handle_alloc()
1752 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in handle_alloc()
1906 uint64_t *l2_slice; in discard_in_l2_slice() local
1911 ret = get_cluster_table(bs, offset, &l2_slice, &l2_index); in discard_in_l2_slice()
1921 uint64_t old_l2_entry = get_l2_entry(s, l2_slice, l2_index + i); in discard_in_l2_slice()
1922 uint64_t old_l2_bitmap = get_l2_bitmap(s, l2_slice, l2_index + i); in discard_in_l2_slice()
1973 qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice); in discard_in_l2_slice()
1974 set_l2_entry(s, l2_slice, l2_index + i, new_l2_entry); in discard_in_l2_slice()
1976 set_l2_bitmap(s, l2_slice, l2_index + i, new_l2_bitmap); in discard_in_l2_slice()
1990 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in discard_in_l2_slice()
2045 uint64_t *l2_slice; in zero_in_l2_slice() local
2050 ret = get_cluster_table(bs, offset, &l2_slice, &l2_index); in zero_in_l2_slice()
2060 uint64_t old_l2_entry = get_l2_entry(s, l2_slice, l2_index + i); in zero_in_l2_slice()
2061 uint64_t old_l2_bitmap = get_l2_bitmap(s, l2_slice, l2_index + i); in zero_in_l2_slice()
2085 qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice); in zero_in_l2_slice()
2086 set_l2_entry(s, l2_slice, l2_index + i, new_l2_entry); in zero_in_l2_slice()
2088 set_l2_bitmap(s, l2_slice, l2_index + i, new_l2_bitmap); in zero_in_l2_slice()
2105 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in zero_in_l2_slice()
2115 uint64_t *l2_slice; in zero_l2_subclusters() local
2124 ret = get_cluster_table(bs, offset, &l2_slice, &l2_index); in zero_l2_subclusters()
2129 switch (qcow2_get_cluster_type(bs, get_l2_entry(s, l2_slice, l2_index))) { in zero_l2_subclusters()
2140 old_l2_bitmap = l2_bitmap = get_l2_bitmap(s, l2_slice, l2_index); in zero_l2_subclusters()
2146 set_l2_bitmap(s, l2_slice, l2_index, l2_bitmap); in zero_l2_subclusters()
2147 qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice); in zero_l2_subclusters()
2152 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in zero_l2_subclusters()
2257 uint64_t *l2_slice = NULL; in expand_zero_clusters_in_l1() local
2271 l2_slice = qemu_try_blockalign(bs->file->bs, slice_size2); in expand_zero_clusters_in_l1()
2272 if (l2_slice == NULL) { in expand_zero_clusters_in_l1()
2310 (void **)&l2_slice); in expand_zero_clusters_in_l1()
2314 l2_slice, 0); in expand_zero_clusters_in_l1()
2321 uint64_t l2_entry = get_l2_entry(s, l2_slice, j); in expand_zero_clusters_in_l1()
2338 set_l2_entry(s, l2_slice, j, 0); in expand_zero_clusters_in_l1()
2404 set_l2_entry(s, l2_slice, j, offset | QCOW_OFLAG_COPIED); in expand_zero_clusters_in_l1()
2406 set_l2_entry(s, l2_slice, j, offset); in expand_zero_clusters_in_l1()
2417 qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_slice); in expand_zero_clusters_in_l1()
2420 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in expand_zero_clusters_in_l1()
2431 l2_slice, 0); in expand_zero_clusters_in_l1()
2448 if (l2_slice) { in expand_zero_clusters_in_l1()
2450 qemu_vfree(l2_slice); in expand_zero_clusters_in_l1()
2452 qcow2_cache_put(s->l2_table_cache, (void **) &l2_slice); in expand_zero_clusters_in_l1()