diff options
author | Kevin Wolf <kwolf@redhat.com> | 2012-12-07 18:08:42 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-12-13 15:37:59 +0100 |
commit | 1d3afd649bc77aa14bc2741e2da6475822d41c5f (patch) | |
tree | 48d6c4f5fb3371a92b9e9c824e133cd121fa808f /block/qcow2.h | |
parent | a7f3d65b65b8c86a5ff0c0abcfefb45e2ec6fe4c (diff) |
qcow2: Round QCowL2Meta.offset down to cluster boundary
The offset within the cluster is already present as n_start and this is
what the code uses. QCowL2Meta.offset is only needed at a cluster
granularity.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r-- | block/qcow2.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h index b4eb65470e..2a406a7e83 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -199,12 +199,34 @@ struct QCowAIOCB; /* XXX This could be private for qcow2-cluster.c */ typedef struct QCowL2Meta { + /** Guest offset of the first newly allocated cluster */ uint64_t offset; + + /** Host offset of the first cluster of the request */ uint64_t cluster_offset; + + /** Host offset of the first newly allocated cluster */ uint64_t alloc_offset; + + /** + * Number of sectors between the start of the first allocated cluster and + * the area that the guest actually writes to. + */ int n_start; + + /** + * Number of sectors from the start of the first allocated cluster to + * the end of the (possibly shortened) request + */ int nb_available; + + /** Number of newly allocated clusters */ int nb_clusters; + + /** + * Requests that overlap with this allocation and wait to be restarted + * when the allocating request has completed. + */ CoQueue dependent_requests; QLIST_ENTRY(QCowL2Meta) next_in_flight; |