summaryrefslogtreecommitdiff
path: root/block/qcow2.h
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-02-10 15:28:48 -0500
committerKevin Wolf <kwolf@redhat.com>2015-03-10 14:02:21 +0100
commit0e06528e980b8ac7695a219f8405d3cdc52a1381 (patch)
treefa20bdce42cbd7327792f009dff30cf721978694 /block/qcow2.h
parent2aabe7c7a16cee6b1b54592fa05b5f9c23c89bc0 (diff)
qcow2: Use 64 bits for refcount values
Refcounts may have a width of up to 64 bits, so qemu should use the same width to represent refcount values internally. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 40910d817d..a9108f55ca 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -459,7 +459,7 @@ static inline uint64_t l2meta_cow_end(QCowL2Meta *m)
+ (m->cow_end.nb_sectors << BDRV_SECTOR_BITS);
}
-static inline uint16_t refcount_diff(uint16_t r1, uint16_t r2)
+static inline uint64_t refcount_diff(uint64_t r1, uint64_t r2)
{
return r1 > r2 ? r1 - r2 : r2 - r1;
}
@@ -484,10 +484,10 @@ int qcow2_refcount_init(BlockDriverState *bs);
void qcow2_refcount_close(BlockDriverState *bs);
int qcow2_get_refcount(BlockDriverState *bs, int64_t cluster_index,
- uint16_t *refcount);
+ uint64_t *refcount);
int qcow2_update_cluster_refcount(BlockDriverState *bs, int64_t cluster_index,
- uint16_t addend, bool decrease,
+ uint64_t addend, bool decrease,
enum qcow2_discard_type type);
int64_t qcow2_alloc_clusters(BlockDriverState *bs, uint64_t size);