cache tools work

This commit is contained in:
Joe Thornber 2013-03-18 13:56:30 +00:00
parent 843cf76d41
commit 43d5d8d2a2
3 changed files with 13 additions and 10 deletions

1
cache/check.cc vendored
View File

@ -105,3 +105,4 @@ int main(int argc, char **argv)
cerr << "not implemented" << endl;
return 1;
}
#endif

View File

@ -16,7 +16,7 @@
// with thin-provisioning-tools. If not, see
// <http://www.gnu.org/licenses/>.
#include "cache_metadata_disk_structures.h"
#include "metadata_disk_structures.h"
#include <string.h>
@ -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);

View File

@ -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;