[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 5/6] qcow2: Add more overlap check bitmask macros
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v2 5/6] qcow2: Add more overlap check bitmask macros |
Date: |
Thu, 10 Oct 2013 11:09:27 +0200 |
Introduces the macros QCOW2_OL_CONSTANT and QCOW2_OL_ALL in addition to
the already existing QCOW2_OL_CACHED, signifying all metadata overlap
checks that can be performed in constant time (regardless of image size
etc.) and truly all available overlap checks, respectively.
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2.h | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/block/qcow2.h b/block/qcow2.h
index 28ccc4a..922e190 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -326,11 +326,19 @@ typedef enum QCow2MetadataOverlap {
QCOW2_OL_INACTIVE_L2 = (1 << QCOW2_OL_INACTIVE_L2_BITNR),
} QCow2MetadataOverlap;
+/* Perform all overlap checks which can be done in constant time */
+#define QCOW2_OL_CONSTANT \
+ (QCOW2_OL_MAIN_HEADER | QCOW2_OL_ACTIVE_L1 | QCOW2_OL_REFCOUNT_TABLE | \
+ QCOW2_OL_SNAPSHOT_TABLE)
+
/* Perform all overlap checks which don't require disk access */
#define QCOW2_OL_CACHED \
- (QCOW2_OL_MAIN_HEADER | QCOW2_OL_ACTIVE_L1 | QCOW2_OL_ACTIVE_L2 | \
- QCOW2_OL_REFCOUNT_TABLE | QCOW2_OL_REFCOUNT_BLOCK | \
- QCOW2_OL_SNAPSHOT_TABLE | QCOW2_OL_INACTIVE_L1)
+ (QCOW2_OL_CONSTANT | QCOW2_OL_ACTIVE_L2 | QCOW2_OL_REFCOUNT_BLOCK | \
+ QCOW2_OL_INACTIVE_L1)
+
+/* Perform all overlap checks */
+#define QCOW2_OL_ALL \
+ (QCOW2_OL_CACHED | QCOW2_OL_INACTIVE_L2)
#define L1E_OFFSET_MASK 0x00ffffffffffff00ULL
#define L2E_OFFSET_MASK 0x00ffffffffffff00ULL
--
1.8.3.1
- [Qemu-devel] [PATCH v2 0/6] Configure metadata overlap checks at runtime, Max Reitz, 2013/10/10
- [Qemu-devel] [PATCH v2 1/6] qcow2: Use negated overflow check mask, Max Reitz, 2013/10/10
- [Qemu-devel] [PATCH v2 3/6] qcow2: Add overlap-check options, Max Reitz, 2013/10/10
- [Qemu-devel] [PATCH v2 5/6] qcow2: Add more overlap check bitmask macros,
Max Reitz <=
- [Qemu-devel] [PATCH v2 6/6] qcow2: Evaluate overlap check options, Max Reitz, 2013/10/10
- [Qemu-devel] [PATCH v2 2/6] qcow2: Make overlap check mask variable, Max Reitz, 2013/10/10
- [Qemu-devel] [PATCH v2 4/6] qcow2: Array assigning options to OL check bits, Max Reitz, 2013/10/10
- Re: [Qemu-devel] [PATCH v2 0/6] Configure metadata overlap checks at runtime, Kevin Wolf, 2013/10/10