more checksum stuff

This commit is contained in:
Joe Thornber
2011-09-16 10:06:37 +01:00
parent 1f6f79782a
commit 478069c4ec
10 changed files with 114 additions and 13 deletions

11
btree.h
View File

@@ -38,6 +38,8 @@ namespace persistent_data {
using namespace std;
using namespace boost;
uint32_t const BTREE_CSUM_XOR = 121107;
//------------------------------------------------
// On disk data layout for btree nodes
enum node_flags {
@@ -74,6 +76,8 @@ namespace persistent_data {
public:
explicit node_ref(block_address b, disk_node *raw);
uint32_t get_checksum() const;
block_address get_location() const {
return location_;
}
@@ -125,8 +129,11 @@ namespace persistent_data {
template <typename RefCounter>
void inc_children(RefCounter &rc);
// FIXME: remove
void *raw() {
disk_node *raw() {
return raw_;
}
disk_node const *raw() const {
return raw_;
}