aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.h
diff options
context:
space:
mode:
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 c4eaf670ec..32806bd035 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;