thin-provisioning-tools/era/era_detail.h

50 lines
1.0 KiB
C
Raw Normal View History

2013-11-19 15:54:31 +05:30
#ifndef ERA_DETAIL_H
#define ERA_DETAIL_H
#include "base/endian_utils.h"
2014-01-15 05:29:12 +05:30
#include "persistent-data/transaction_manager.h"
2013-11-19 15:54:31 +05:30
//----------------------------------------------------------------
namespace era {
struct era_detail_disk {
base::le32 nr_bits;
base::le64 writeset_root;
} __attribute__ ((packed));
2013-11-19 15:54:31 +05:30
struct era_detail {
era_detail()
: nr_bits(0),
writeset_root(0) {
}
2013-11-19 15:54:31 +05:30
uint32_t nr_bits;
uint64_t writeset_root;
2013-11-19 15:54:31 +05:30
};
2014-01-23 06:16:03 +05:30
// FIXME: implement
2014-01-15 05:29:12 +05:30
struct era_detail_ref_counter {
2014-01-23 06:16:03 +05:30
era_detail_ref_counter(persistent_data::transaction_manager::ptr tm) {
}
2014-01-15 05:29:12 +05:30
2014-01-23 06:16:03 +05:30
void inc(persistent_data::block_address b) {
}
void dec(persistent_data::block_address b) {
}
2014-01-15 05:29:12 +05:30
};
2013-11-19 15:54:31 +05:30
struct era_detail_traits {
typedef era_detail_disk disk_type;
typedef era_detail value_type;
2014-01-15 05:29:12 +05:30
typedef era_detail_ref_counter ref_counter;
2013-11-19 15:54:31 +05:30
static void unpack(disk_type const &disk, value_type &value);
static void pack(value_type const &value, disk_type &disk);
};
}
//----------------------------------------------------------------
#endif