From 43d5d8d2a2a2fdb125ebb982baa02cb9441bde30 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 18 Mar 2013 13:56:30 +0000 Subject: [PATCH] cache tools work --- cache/check.cc | 1 + cache/metadata_disk_structures.cc | 4 ++-- cache/metadata_disk_structures.h | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cache/check.cc b/cache/check.cc index c306689..108310d 100644 --- a/cache/check.cc +++ b/cache/check.cc @@ -105,3 +105,4 @@ int main(int argc, char **argv) cerr << "not implemented" << endl; return 1; } +#endif diff --git a/cache/metadata_disk_structures.cc b/cache/metadata_disk_structures.cc index e3d369f..2bdbf81 100644 --- a/cache/metadata_disk_structures.cc +++ b/cache/metadata_disk_structures.cc @@ -16,7 +16,7 @@ // with thin-provisioning-tools. If not, see // . -#include "cache_metadata_disk_structures.h" +#include "metadata_disk_structures.h" #include @@ -68,7 +68,7 @@ superblock_traits::unpack(superblock_disk const &disk, superblock &core) } void -superblock_traits::pack(superblock const &value, superblock_disk &disk) +superblock_traits::pack(superblock const &core, superblock_disk &disk) { disk.csum = to_disk<__le32>(core.csum); disk.flags = to_disk<__le32>(core.flags); diff --git a/cache/metadata_disk_structures.h b/cache/metadata_disk_structures.h index 7eebb24..fed8018 100644 --- a/cache/metadata_disk_structures.h +++ b/cache/metadata_disk_structures.h @@ -19,8 +19,8 @@ #ifndef CACHE_METADATA_DISK_STRUCTURES_H #define CACHE_METADATA_DISK_STRUCTURES_H -#include "endian_utils.h" -#include "btree.h" +#include "persistent-data/endian_utils.h" +#include "persistent-data/data-structures/btree.h" //---------------------------------------------------------------- @@ -29,6 +29,8 @@ namespace cache_tools { using namespace base; // FIXME: don't use namespaces in headers. unsigned const SPACE_MAP_ROOT_SIZE = 128; + unsigned const CACHE_POLICY_NAME_SIZE = 16; + unsigned const CACHE_POLICY_VERSION_SIZE = 3; typedef unsigned char __u8; @@ -58,9 +60,9 @@ namespace cache_tools { __le32 metadata_block_size; /* in 512-byte sectors */ __le32 cache_blocks; - __le32 compat_flags_; - __le32 compat_ro_flags_; - __le32 incompat_flags_; + __le32 compat_flags; + __le32 compat_ro_flags; + __le32 incompat_flags; __le32 read_hits; __le32 read_misses; @@ -94,9 +96,9 @@ namespace cache_tools { uint32_t metadata_block_size; /* in 512-byte sectors */ uint32_t cache_blocks; - uint32_t compat_flags_; - uint32_t compat_ro_flags_; - uint32_t incompat_flags_; + uint32_t compat_flags; + uint32_t compat_ro_flags; + uint32_t incompat_flags; uint32_t read_hits; uint32_t read_misses;