Home | History | Annotate | Download | only in block

Lines Matching refs:cluster_offset

350     uint64_t cluster_offset;
356 &cluster_offset);
362 if (!cluster_offset) {
375 } else if (cluster_offset & QCOW_OFLAG_COMPRESSED) {
376 if (qcow2_decompress_cluster(bs, cluster_offset) < 0)
381 ret = bdrv_pread(bs->file, cluster_offset + index_in_cluster * 512, buf, n * 512);
397 uint64_t cluster_offset, int n_start, int n_end)
416 ret = bdrv_write_sync(bs->file, (cluster_offset >> 9) + n_start,
428 * qcow2 file. The offset is stored in *cluster_offset.
441 int *num, uint64_t *cluster_offset)
470 *cluster_offset = 0;
496 *cluster_offset = be64_to_cpu(l2_table[l2_index]);
499 if (!*cluster_offset) {
515 *cluster_offset &=~QCOW_OFLAG_COPIED;
602 int64_t cluster_offset;
610 cluster_offset = be64_to_cpu(l2_table[l2_index]);
611 if (cluster_offset & QCOW_OFLAG_COPIED)
612 return cluster_offset & ~QCOW_OFLAG_COPIED;
614 if (cluster_offset)
615 qcow2_free_any_clusters(bs, cluster_offset, 1);
617 cluster_offset = qcow2_alloc_bytes(bs, compressed_size);
618 if (cluster_offset < 0) {
622 nb_csectors = ((cluster_offset + compressed_size - 1) >> 9) -
623 (cluster_offset >> 9);
625 cluster_offset |= QCOW_OFLAG_COMPRESSED |
633 l2_table[l2_index] = cpu_to_be64(cluster_offset);
640 return cluster_offset;
672 uint64_t cluster_offset = m->cluster_offset;
682 ret = copy_sectors(bs, start_sect, cluster_offset, 0, m->n_start);
689 ret = copy_sectors(bs, start_sect + end, cluster_offset + (end << 9),
711 l2_table[l2_index + i] = cpu_to_be64((cluster_offset +
756 int64_t cluster_offset;
769 cluster_offset = be64_to_cpu(l2_table[l2_index]);
773 if (cluster_offset & QCOW_OFLAG_COPIED) {
777 cluster_offset &= ~QCOW_OFLAG_COPIED;
786 if (cluster_offset & QCOW_OFLAG_COMPRESSED)
804 cluster_offset = be64_to_cpu(l2_table[l2_index + i]);
806 if ((cluster_offset & QCOW_OFLAG_COPIED) ||
807 (cluster_offset & QCOW_OFLAG_COMPRESSED))
853 cluster_offset = qcow2_alloc_clusters(bs, nb_clusters * s->cluster_size);
854 if (cluster_offset < 0) {
856 return cluster_offset;
866 m->cluster_offset = cluster_offset;
900 int qcow2_decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset)
906 coffset = cluster_offset & s->cluster_offset_mask;
908 nb_csectors = ((cluster_offset >> s->csize_shift) & s->csize_mask) + 1;