[cache_restore] The metadata version and clean shutdown flags were

swapped.

Reveal by failing --omit-clean-shutdown test
This commit is contained in:
Joe Thornber 2017-08-29 12:33:32 +01:00
parent 61d747b246
commit 4da8d19f29
3 changed files with 12 additions and 5 deletions

View File

@ -60,8 +60,9 @@ namespace {
try {
block_manager<>::ptr bm = open_bm(*fs.output, block_manager<>::READ_WRITE);
metadata::ptr md(new metadata(bm, metadata::CREATE));
emitter::ptr restorer = create_restore_emitter(md, fs.clean_shutdown,
fs.metadata_version);
emitter::ptr restorer = create_restore_emitter(md,
fs.metadata_version,
fs.clean_shutdown ? CLEAN_SHUTDOWN : NO_CLEAN_SHUTDOWN);
check_file_exists(*fs.input);
ifstream in(fs.input->c_str(), ifstream::in);

View File

@ -115,9 +115,9 @@ namespace {
emitter::ptr
caching::create_restore_emitter(metadata::ptr md, unsigned metadata_version,
bool clean_shutdown)
shutdown_type st)
{
return emitter::ptr(new restorer(md, clean_shutdown, metadata_version));
return emitter::ptr(new restorer(md, st == CLEAN_SHUTDOWN, metadata_version));
}
//----------------------------------------------------------------

View File

@ -7,9 +7,15 @@
//----------------------------------------------------------------
namespace caching {
enum shutdown_type {
CLEAN_SHUTDOWN,
NO_CLEAN_SHUTDOWN
};
emitter::ptr create_restore_emitter(metadata::ptr md,
unsigned metadata_version,
bool clean_shutdown = true);
shutdown_type st = CLEAN_SHUTDOWN);
}
//----------------------------------------------------------------