From d710cad52bcde704b170b2de2b021bb372d1ae50 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 7 Oct 2016 15:01:16 -0400 Subject: [PATCH] [cache tools] knock out OPEN from the metadata enum --- caching/cache_dump.cc | 2 +- caching/cache_repair.cc | 2 +- caching/cache_writeback.cc | 2 +- caching/metadata.h | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/caching/cache_dump.cc b/caching/cache_dump.cc index 1831752..ec3e31c 100644 --- a/caching/cache_dump.cc +++ b/caching/cache_dump.cc @@ -36,7 +36,7 @@ namespace { int dump(string const &dev, string const &output, flags const &fs) { try { block_manager<>::ptr bm = open_bm(dev, block_manager<>::READ_ONLY); - metadata::ptr md(new metadata(bm, metadata::OPEN)); + metadata::ptr md(new metadata(bm)); if (want_stdout(output)) { emitter::ptr e = create_xml_emitter(cout); diff --git a/caching/cache_repair.cc b/caching/cache_repair.cc index bfc92c8..9587d5f 100644 --- a/caching/cache_repair.cc +++ b/caching/cache_repair.cc @@ -19,7 +19,7 @@ using namespace caching; namespace { metadata::ptr open_metadata_for_read(string const &path) { block_manager<>::ptr bm = open_bm(path, block_manager<>::READ_ONLY); - return metadata::ptr(new metadata(bm, metadata::OPEN)); + return metadata::ptr(new metadata(bm)); } emitter::ptr output_emitter(string const &path) { diff --git a/caching/cache_writeback.cc b/caching/cache_writeback.cc index 7dbf4c3..a754c9c 100644 --- a/caching/cache_writeback.cc +++ b/caching/cache_writeback.cc @@ -298,7 +298,7 @@ namespace { int writeback_(flags const &f) { block_manager<>::ptr bm = open_bm(*f.metadata_dev, block_manager<>::READ_WRITE); - metadata md(bm, metadata::OPEN); + metadata md(bm); // FIXME: we're going to have to copy runs to get the through put with small block sizes unsigned max_ios = f.cache_size / (md.sb_.data_block_size << SECTOR_SHIFT); diff --git a/caching/metadata.h b/caching/metadata.h index 268b2f5..1bb3607 100644 --- a/caching/metadata.h +++ b/caching/metadata.h @@ -19,8 +19,7 @@ namespace caching { class metadata { public: enum open_type { - CREATE, - OPEN + CREATE }; typedef block_manager<>::read_ref read_ref;