diff options
author | Eric Blake <eblake@redhat.com> | 2017-05-06 19:05:45 -0500 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2017-05-11 14:28:06 +0200 |
commit | 3ef9521893c41638148d4452ee4da75fd8ef71a9 (patch) | |
tree | 9dee34fb20940649bcfc503c0cac5ea98c670caf /block/qcow2-refcount.c | |
parent | 4341df8a83d6a528a1e2855735f87fc3aab42b70 (diff) |
qcow2: Name typedef for cluster type
Although it doesn't add all that much type safety (this is C, after
all), it does add a bit of legibility to use the name QCow2ClusterType
instead of a plain int.
In particular, qcow2_get_cluster_offset() has an overloaded return
type; a QCow2ClusterType on success, and -errno on failure; keeping
the cluster type in a separate variable makes it slightly easier for
the next patch to make further computations based on the type.
Suggested-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-id: 20170507000552.20847-6-eblake@redhat.com
[mreitz: Use the new type in two more places (one of them pulled from
the next patch)]
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2-refcount.c')
-rw-r--r-- | block/qcow2-refcount.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 908dbe5314..e639b341e5 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1640,7 +1640,7 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res, for (j = 0; j < s->l2_size; j++) { uint64_t l2_entry = be64_to_cpu(l2_table[j]); uint64_t data_offset = l2_entry & L2E_OFFSET_MASK; - int cluster_type = qcow2_get_cluster_type(l2_entry); + QCow2ClusterType cluster_type = qcow2_get_cluster_type(l2_entry); if ((cluster_type == QCOW2_CLUSTER_NORMAL) || ((cluster_type == QCOW2_CLUSTER_ZERO) && (data_offset != 0))) { |