g++ 4.4 fixups
This commit is contained in:
parent
28a2639036
commit
b4dbf8d74c
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,5 +4,6 @@
|
|||||||
*.d
|
*.d
|
||||||
test.data
|
test.data
|
||||||
thin_dump
|
thin_dump
|
||||||
|
thin_restore
|
||||||
thin_repair
|
thin_repair
|
||||||
*.metadata
|
*.metadata
|
4
Makefile
4
Makefile
@ -12,8 +12,8 @@ SOURCE=\
|
|||||||
|
|
||||||
OBJECTS=$(subst .cc,.o,$(SOURCE))
|
OBJECTS=$(subst .cc,.o,$(SOURCE))
|
||||||
TOP_DIR:=$(PWD)
|
TOP_DIR:=$(PWD)
|
||||||
#CPPFLAGS=-Wall -g -I$(TOP_DIR)
|
CPPFLAGS=-Wall -g -I$(TOP_DIR)
|
||||||
CPPFLAGS=-Wall -std=c++0x -g -I$(TOP_DIR)
|
#CPPFLAGS=-Wall -std=c++0x -g -I$(TOP_DIR)
|
||||||
LIBS=-lstdc++
|
LIBS=-lstdc++
|
||||||
|
|
||||||
.PHONEY: test-programs
|
.PHONEY: test-programs
|
||||||
|
18
btree.h
18
btree.h
@ -165,7 +165,7 @@ namespace persistent_data {
|
|||||||
|
|
||||||
class ro_spine : private noncopyable {
|
class ro_spine : private noncopyable {
|
||||||
public:
|
public:
|
||||||
ro_spine(typename transaction_manager::ptr tm)
|
ro_spine(transaction_manager::ptr tm)
|
||||||
: tm_(tm) {
|
: tm_(tm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,16 +181,16 @@ namespace persistent_data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typename transaction_manager::ptr tm_;
|
transaction_manager::ptr tm_;
|
||||||
std::list<typename block_manager<>::read_ref> spine_;
|
std::list<block_manager<>::read_ref> spine_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class shadow_spine : private noncopyable {
|
class shadow_spine : private noncopyable {
|
||||||
public:
|
public:
|
||||||
typedef typename transaction_manager::read_ref read_ref;
|
typedef transaction_manager::read_ref read_ref;
|
||||||
typedef typename transaction_manager::write_ref write_ref;
|
typedef transaction_manager::write_ref write_ref;
|
||||||
|
|
||||||
shadow_spine(typename transaction_manager::ptr tm)
|
shadow_spine(transaction_manager::ptr tm)
|
||||||
: tm_(tm) {
|
: tm_(tm) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ namespace persistent_data {
|
|||||||
return p.second;
|
return p.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void step(typename transaction_manager::write_ref b) {
|
void step(transaction_manager::write_ref b) {
|
||||||
spine_.push_back(b);
|
spine_.push_back(b);
|
||||||
if (spine_.size() == 1)
|
if (spine_.size() == 1)
|
||||||
root_ = spine_.front().get_location();
|
root_ = spine_.front().get_location();
|
||||||
@ -247,8 +247,8 @@ namespace persistent_data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typename transaction_manager::ptr tm_;
|
transaction_manager::ptr tm_;
|
||||||
std::list<typename block_manager<>::write_ref> spine_;
|
std::list<block_manager<>::write_ref> spine_;
|
||||||
block_address root_;
|
block_address root_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -81,17 +81,17 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void *bitmap_data(typename transaction_manager::write_ref &wr) {
|
void *bitmap_data(transaction_manager::write_ref &wr) {
|
||||||
bitmap_header *h = reinterpret_cast<bitmap_header *>(&wr.data()[0]);
|
bitmap_header *h = reinterpret_cast<bitmap_header *>(&wr.data()[0]);
|
||||||
return h + 1;
|
return h + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void const *bitmap_data(typename transaction_manager::read_ref &rr) const {
|
void const *bitmap_data(transaction_manager::read_ref &rr) const {
|
||||||
bitmap_header const *h = reinterpret_cast<bitmap_header const *>(&rr.data()[0]);
|
bitmap_header const *h = reinterpret_cast<bitmap_header const *>(&rr.data()[0]);
|
||||||
return h + 1;
|
return h + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename transaction_manager::ptr tm_;
|
transaction_manager::ptr tm_;
|
||||||
index_entry ie_;
|
index_entry ie_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ namespace {
|
|||||||
ref_counts_(tm_, ref_count_traits::ref_counter()) {
|
ref_counts_(tm_, ref_count_traits::ref_counter()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sm_disk_base(typename transaction_manager::ptr tm,
|
sm_disk_base(transaction_manager::ptr tm,
|
||||||
sm_root const &root)
|
sm_root const &root)
|
||||||
: tm_(tm),
|
: tm_(tm),
|
||||||
entries_per_block_((MD_BLOCK_SIZE - sizeof(bitmap_header)) * 4),
|
entries_per_block_((MD_BLOCK_SIZE - sizeof(bitmap_header)) * 4),
|
||||||
@ -239,12 +239,12 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void check(block_counter &counter) const {
|
virtual void check(block_counter &counter) const {
|
||||||
typename ref_count_validator::ptr v(new ref_count_validator(counter));
|
ref_count_validator::ptr v(new ref_count_validator(counter));
|
||||||
ref_counts_.visit(v);
|
ref_counts_.visit(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typename transaction_manager::ptr get_tm() const {
|
transaction_manager::ptr get_tm() const {
|
||||||
return tm_;
|
return tm_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ namespace {
|
|||||||
void check(block_counter &counter) const {
|
void check(block_counter &counter) const {
|
||||||
sm_disk_base::check(counter);
|
sm_disk_base::check(counter);
|
||||||
|
|
||||||
typename bitmap_tree_validator::ptr v(new bitmap_tree_validator(counter));
|
bitmap_tree_validator::ptr v(new bitmap_tree_validator(counter));
|
||||||
bitmaps_.visit(v);
|
bitmaps_.visit(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,7 +446,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void load_ies() {
|
void load_ies() {
|
||||||
typename block_manager<>::read_ref rr =
|
block_manager<>::read_ref rr =
|
||||||
sm_disk_base::get_tm()->read_lock(bitmap_root_);
|
sm_disk_base::get_tm()->read_lock(bitmap_root_);
|
||||||
|
|
||||||
metadata_index const *mdi = reinterpret_cast<metadata_index const *>(&rr.data());
|
metadata_index const *mdi = reinterpret_cast<metadata_index const *>(&rr.data());
|
||||||
@ -458,7 +458,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void commit_ies() {
|
void commit_ies() {
|
||||||
std::pair<typename block_manager<>::write_ref, bool> p =
|
std::pair<block_manager<>::write_ref, bool> p =
|
||||||
sm_disk_base::get_tm()->shadow(bitmap_root_);
|
sm_disk_base::get_tm()->shadow(bitmap_root_);
|
||||||
|
|
||||||
bitmap_root_ = p.first.get_location();
|
bitmap_root_ = p.first.get_location();
|
||||||
|
@ -8,7 +8,7 @@ using namespace std;
|
|||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
transaction_manager::transaction_manager(typename block_manager<>::ptr bm,
|
transaction_manager::transaction_manager(block_manager<>::ptr bm,
|
||||||
space_map::ptr sm)
|
space_map::ptr sm)
|
||||||
: bm_(bm),
|
: bm_(bm),
|
||||||
sm_(sm)
|
sm_(sm)
|
||||||
|
@ -13,15 +13,15 @@ namespace persistent_data {
|
|||||||
class transaction_manager : boost::noncopyable {
|
class transaction_manager : boost::noncopyable {
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<transaction_manager> ptr;
|
typedef boost::shared_ptr<transaction_manager> ptr;
|
||||||
typedef typename block_manager<>::read_ref read_ref;
|
typedef block_manager<>::read_ref read_ref;
|
||||||
typedef typename block_manager<>::write_ref write_ref;
|
typedef block_manager<>::write_ref write_ref;
|
||||||
typedef typename block_manager<>::validator::ptr validator;
|
typedef block_manager<>::validator::ptr validator;
|
||||||
|
|
||||||
// If the space map is persistent, then the caller should
|
// If the space map is persistent, then the caller should
|
||||||
// hold onto a reference and remember to call sm_->commit()
|
// hold onto a reference and remember to call sm_->commit()
|
||||||
// and update the superblock before dropping the superblock
|
// and update the superblock before dropping the superblock
|
||||||
// reference.
|
// reference.
|
||||||
transaction_manager(typename block_manager<>::ptr bm,
|
transaction_manager(block_manager<>::ptr bm,
|
||||||
space_map::ptr sm);
|
space_map::ptr sm);
|
||||||
~transaction_manager();
|
~transaction_manager();
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ namespace persistent_data {
|
|||||||
return sm_;
|
return sm_;
|
||||||
}
|
}
|
||||||
|
|
||||||
typename block_manager<>::ptr get_bm() {
|
block_manager<>::ptr get_bm() {
|
||||||
return bm_;
|
return bm_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ namespace persistent_data {
|
|||||||
bool is_shadow(block_address b) const;
|
bool is_shadow(block_address b) const;
|
||||||
void wipe_shadow_table();
|
void wipe_shadow_table();
|
||||||
|
|
||||||
typename block_manager<>::ptr bm_;
|
block_manager<>::ptr bm_;
|
||||||
space_map::ptr sm_;
|
space_map::ptr sm_;
|
||||||
|
|
||||||
std::set<block_address> shadows_;
|
std::set<block_address> shadows_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user