|
|
72cacb |
caching/cache_restore.cc | 5 +++--
|
|
|
72cacb |
caching/restore_emitter.cc | 4 ++--
|
|
|
72cacb |
caching/restore_emitter.h | 8 +++++++-
|
|
|
72cacb |
3 files changed, 12 insertions(+), 5 deletions(-)
|
|
|
72cacb |
|
|
|
72cacb |
diff --git a/caching/cache_restore.cc b/caching/cache_restore.cc
|
|
|
72cacb |
index f62306d..e430c11 100644
|
|
|
72cacb |
--- a/caching/cache_restore.cc
|
|
|
72cacb |
+++ b/caching/cache_restore.cc
|
|
|
72cacb |
@@ -69,8 +69,9 @@ namespace {
|
|
|
72cacb |
try {
|
|
|
72cacb |
block_manager<>::ptr bm = open_bm(*fs.output, block_manager<>::READ_WRITE);
|
|
|
72cacb |
metadata::ptr md(new metadata(bm, metadata::CREATE));
|
|
|
72cacb |
- emitter::ptr restorer = create_restore_emitter(md, fs.clean_shutdown,
|
|
|
72cacb |
- fs.metadata_version);
|
|
|
72cacb |
+ emitter::ptr restorer = create_restore_emitter(md,
|
|
|
72cacb |
+ fs.metadata_version,
|
|
|
72cacb |
+ fs.clean_shutdown ? CLEAN_SHUTDOWN : NO_CLEAN_SHUTDOWN);
|
|
|
72cacb |
|
|
|
72cacb |
check_file_exists(*fs.input);
|
|
|
72cacb |
ifstream in(fs.input->c_str(), ifstream::in);
|
|
|
72cacb |
diff --git a/caching/restore_emitter.cc b/caching/restore_emitter.cc
|
|
|
72cacb |
index 34c5020..b7a573f 100644
|
|
|
72cacb |
--- a/caching/restore_emitter.cc
|
|
|
72cacb |
+++ b/caching/restore_emitter.cc
|
|
|
72cacb |
@@ -115,9 +115,9 @@ namespace {
|
|
|
72cacb |
|
|
|
72cacb |
emitter::ptr
|
|
|
72cacb |
caching::create_restore_emitter(metadata::ptr md, unsigned metadata_version,
|
|
|
72cacb |
- bool clean_shutdown)
|
|
|
72cacb |
+ shutdown_type st)
|
|
|
72cacb |
{
|
|
|
72cacb |
- return emitter::ptr(new restorer(md, clean_shutdown, metadata_version));
|
|
|
72cacb |
+ return emitter::ptr(new restorer(md, st == CLEAN_SHUTDOWN, metadata_version));
|
|
|
72cacb |
}
|
|
|
72cacb |
|
|
|
72cacb |
//----------------------------------------------------------------
|
|
|
72cacb |
diff --git a/caching/restore_emitter.h b/caching/restore_emitter.h
|
|
|
72cacb |
index 5c077af..a1d45d6 100644
|
|
|
72cacb |
--- a/caching/restore_emitter.h
|
|
|
72cacb |
+++ b/caching/restore_emitter.h
|
|
|
72cacb |
@@ -7,9 +7,15 @@
|
|
|
72cacb |
//----------------------------------------------------------------
|
|
|
72cacb |
|
|
|
72cacb |
namespace caching {
|
|
|
72cacb |
+
|
|
|
72cacb |
+ enum shutdown_type {
|
|
|
72cacb |
+ CLEAN_SHUTDOWN,
|
|
|
72cacb |
+ NO_CLEAN_SHUTDOWN
|
|
|
72cacb |
+ };
|
|
|
72cacb |
+
|
|
|
72cacb |
emitter::ptr create_restore_emitter(metadata::ptr md,
|
|
|
72cacb |
unsigned metadata_version,
|
|
|
72cacb |
- bool clean_shutdown = true);
|
|
|
72cacb |
+ shutdown_type st = CLEAN_SHUTDOWN);
|
|
|
72cacb |
}
|
|
|
72cacb |
|
|
|
72cacb |
//----------------------------------------------------------------
|