Expose validator creation interface

This commit is contained in:
Ming-Hung Tsai 2016-02-27 15:21:05 +08:00
parent 992ad02ce9
commit 45e9916428
2 changed files with 16 additions and 5 deletions

View File

@ -87,11 +87,6 @@ namespace {
} }
}; };
bcache::validator::ptr
index_validator() {
return bcache::validator::ptr(new index_block_validator());
}
//-------------------------------- //--------------------------------
class bitmap { class bitmap {
@ -773,4 +768,14 @@ persistent_data::open_metadata_sm(transaction_manager &tm, void *root)
checked_space_map::ptr(new sm_disk(store, tm, v)))); checked_space_map::ptr(new sm_disk(store, tm, v))));
} }
bcache::validator::ptr
persistent_data::bitmap_validator() {
return bcache::validator::ptr(new bitmap_block_validator());
}
bcache::validator::ptr
persistent_data::index_validator() {
return bcache::validator::ptr(new index_block_validator());
}
//---------------------------------------------------------------- //----------------------------------------------------------------

View File

@ -36,6 +36,12 @@ namespace persistent_data {
checked_space_map::ptr checked_space_map::ptr
open_metadata_sm(transaction_manager &tm, void *root); open_metadata_sm(transaction_manager &tm, void *root);
bcache::validator::ptr
bitmap_validator();
bcache::validator::ptr
index_validator();
} }
//---------------------------------------------------------------- //----------------------------------------------------------------