summaryrefslogtreecommitdiffstats
path: root/block/qcow2.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-03-26 17:50:03 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-03-28 11:52:43 +0100
commitc37f4cd71d99b7658d238bd8399048fc6e506958 (patch)
treef0bc05960ce05772b5c790da9cbb5f564035b3fe /block/qcow2.h
parent3b8e2e260c8cee63c9253718983a6682dc2771d7 (diff)
downloadhqemu-c37f4cd71d99b7658d238bd8399048fc6e506958.zip
hqemu-c37f4cd71d99b7658d238bd8399048fc6e506958.tar.gz
qcow2: Finalise interface of handle_alloc()
The interface works completely on a byte granularity now and duplicated parameters are removed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index c4eaf67..32806bd 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -271,6 +271,11 @@ static inline int64_t start_of_cluster(BDRVQcowState *s, int64_t offset)
return offset & ~(s->cluster_size - 1);
}
+static inline int64_t offset_into_cluster(BDRVQcowState *s, int64_t offset)
+{
+ return offset & (s->cluster_size - 1);
+}
+
static inline int size_to_clusters(BDRVQcowState *s, int64_t size)
{
return (size + (s->cluster_size - 1)) >> s->cluster_bits;
OpenPOWER on IntegriCloud