aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 45fb7f4299..d956a6cdd2 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -474,6 +474,11 @@ static inline int offset_to_l2_index(BDRVQcow2State *s, int64_t offset)
return (offset >> s->cluster_bits) & (s->l2_size - 1);
}
+static inline int offset_to_l2_slice_index(BDRVQcow2State *s, int64_t offset)
+{
+ return (offset >> s->cluster_bits) & (s->l2_slice_size - 1);
+}
+
static inline int64_t align_offset(int64_t offset, int n)
{
offset = (offset + n - 1) & ~(n - 1);