From 45e9916428f3f13c7ad704d3ea8a46154600f851 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Sat, 27 Feb 2016 15:21:05 +0800 Subject: [PATCH] Expose validator creation interface --- persistent-data/space-maps/disk.cc | 15 ++++++++++----- persistent-data/space-maps/disk.h | 6 ++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/persistent-data/space-maps/disk.cc b/persistent-data/space-maps/disk.cc index e915eb4..cab9583 100644 --- a/persistent-data/space-maps/disk.cc +++ b/persistent-data/space-maps/disk.cc @@ -87,11 +87,6 @@ namespace { } }; - bcache::validator::ptr - index_validator() { - return bcache::validator::ptr(new index_block_validator()); - } - //-------------------------------- 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)))); } +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()); +} + //---------------------------------------------------------------- diff --git a/persistent-data/space-maps/disk.h b/persistent-data/space-maps/disk.h index 0a69f04..775ef7b 100644 --- a/persistent-data/space-maps/disk.h +++ b/persistent-data/space-maps/disk.h @@ -36,6 +36,12 @@ namespace persistent_data { checked_space_map::ptr open_metadata_sm(transaction_manager &tm, void *root); + + bcache::validator::ptr + bitmap_validator(); + + bcache::validator::ptr + index_validator(); } //----------------------------------------------------------------