diff options
author | Kevin Wolf <kwolf@redhat.com> | 2011-01-10 17:17:28 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-01-24 16:41:49 +0100 |
commit | 29c1a7301af752de6721e031d31faa48887204bd (patch) | |
tree | 9a094ebc84619f99d14166f596094042a3d358eb /block/qcow2.h | |
parent | 493810940bfaad0fd5dd9bfb79cdc89519f89588 (diff) |
qcow2: Use QcowCache
Use the new functions of qcow2-cache.c for everything that works on refcount
block and L2 tables.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r-- | block/qcow2.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/block/qcow2.h b/block/qcow2.h index e5473e1efe..11cbce337d 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -51,6 +51,9 @@ #define L2_CACHE_SIZE 16 +/* Must be at least 4 to cover all cases of refcount table growth */ +#define REFCOUNT_CACHE_SIZE 4 + typedef struct QCowHeader { uint32_t magic; uint32_t version; @@ -94,9 +97,10 @@ typedef struct BDRVQcowState { uint64_t cluster_offset_mask; uint64_t l1_table_offset; uint64_t *l1_table; - uint64_t *l2_cache; - uint64_t l2_cache_offsets[L2_CACHE_SIZE]; - uint32_t l2_cache_counts[L2_CACHE_SIZE]; + + Qcow2Cache* l2_table_cache; + Qcow2Cache* refcount_block_cache; + uint8_t *cluster_cache; uint8_t *cluster_data; uint64_t cluster_cache_offset; @@ -105,8 +109,6 @@ typedef struct BDRVQcowState { uint64_t *refcount_table; uint64_t refcount_table_offset; uint32_t refcount_table_size; - uint64_t refcount_block_cache_offset; - uint16_t *refcount_block_cache; int64_t free_cluster_index; int64_t free_byte_offset; |