From 5e347dddbfcd6953470fc9763ec4e0d136619447 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 8 Apr 2020 12:12:59 +0100 Subject: [PATCH] [various] remove dead code. Squashes warnings from clang++ --- block-cache/copier.cc | 1 - block-cache/copier.h | 1 - caching/cache_writeback.cc | 2 -- caching/metadata.cc | 2 -- caching/restore_emitter.cc | 4 +--- caching/superblock.cc | 2 -- era/metadata.cc | 2 -- era/restore_emitter.cc | 1 - era/superblock.cc | 2 -- persistent-data/data-structures/bloom_filter.cc | 6 ++---- persistent-data/data-structures/bloom_filter.h | 1 - persistent-data/space-maps/disk.cc | 14 ++------------ thin-provisioning/superblock.cc | 2 -- 13 files changed, 5 insertions(+), 35 deletions(-) diff --git a/block-cache/copier.cc b/block-cache/copier.cc index b5c21ef..f200878 100644 --- a/block-cache/copier.cc +++ b/block-cache/copier.cc @@ -13,7 +13,6 @@ copier::copier(io_engine &engine, sector_t block_size, size_t mem) : pool_(block_size * 512, mem, PAGE_SIZE), block_size_(block_size), - nr_blocks_(mem / block_size), engine_(engine), src_handle_(engine_.open_file(src, io_engine::M_READ_ONLY)), dest_handle_(engine_.open_file(dest, io_engine::M_READ_WRITE)), diff --git a/block-cache/copier.h b/block-cache/copier.h index bd49966..ef8211a 100644 --- a/block-cache/copier.h +++ b/block-cache/copier.h @@ -88,7 +88,6 @@ namespace bcache { mempool pool_; sector_t block_size_; - unsigned nr_blocks_; io_engine &engine_; io_engine::handle src_handle_; io_engine::handle dest_handle_; diff --git a/caching/cache_writeback.cc b/caching/cache_writeback.cc index 4438433..1e1e52e 100644 --- a/caching/cache_writeback.cc +++ b/caching/cache_writeback.cc @@ -103,7 +103,6 @@ namespace { : copier_(c), block_size_(c.get_block_size()), only_dirty_(only_dirty), - list_failed_blocks_(list_failed_blocks), batch_(sort_buffer), monitor_(monitor), cache_blocks_(cache_blocks) { @@ -228,7 +227,6 @@ namespace { copier &copier_; unsigned block_size_; bool only_dirty_; - bool list_failed_blocks_; copy_stats stats_; copy_batch batch_; diff --git a/caching/metadata.cc b/caching/metadata.cc index 7b150be..b8d3183 100644 --- a/caching/metadata.cc +++ b/caching/metadata.cc @@ -8,8 +8,6 @@ namespace pd = persistent_data; //---------------------------------------------------------------- namespace { - unsigned const METADATA_CACHE_SIZE = 1024; - // FIXME: duplication transaction_manager::ptr open_tm(block_manager<>::ptr bm) { diff --git a/caching/restore_emitter.cc b/caching/restore_emitter.cc index 5c30b9f..d54f0f8 100644 --- a/caching/restore_emitter.cc +++ b/caching/restore_emitter.cc @@ -12,8 +12,7 @@ namespace { class restorer : public emitter { public: restorer(metadata::ptr md, bool clean_shutdown, unsigned metadata_version) - : in_superblock_(false), - md_(md), + : md_(md), clean_shutdown_(clean_shutdown), metadata_version_(metadata_version) { } @@ -104,7 +103,6 @@ namespace { } private: - bool in_superblock_; metadata::ptr md_; bool clean_shutdown_; unsigned metadata_version_; diff --git a/caching/superblock.cc b/caching/superblock.cc index 500b5ff..630762c 100644 --- a/caching/superblock.cc +++ b/caching/superblock.cc @@ -289,8 +289,6 @@ superblock_invalid::visit(damage_visitor &v) const namespace validator { using namespace persistent_data; - uint32_t const VERSION = 1; - unsigned const SECTOR_TO_BLOCK_SHIFT = 3; uint32_t const SUPERBLOCK_CSUM_SEED = 9031977; struct sb_validator : public bcache::validator { diff --git a/era/metadata.cc b/era/metadata.cc index 40861b1..905b0d2 100644 --- a/era/metadata.cc +++ b/era/metadata.cc @@ -6,8 +6,6 @@ using namespace era; //---------------------------------------------------------------- namespace { - unsigned const METADATA_CACHE_SIZ = 1024; - // FIXME: duplication transaction_manager::ptr open_tm(block_manager<>::ptr bm) { diff --git a/era/restore_emitter.cc b/era/restore_emitter.cc index 85fbe6b..c09fa66 100644 --- a/era/restore_emitter.cc +++ b/era/restore_emitter.cc @@ -99,7 +99,6 @@ namespace { pd::bitset::ptr bits_; bool in_era_array_; - uint32_t nr_blocks_; }; } diff --git a/era/superblock.cc b/era/superblock.cc index 53b5678..4c97e9b 100644 --- a/era/superblock.cc +++ b/era/superblock.cc @@ -208,8 +208,6 @@ superblock_invalid::visit(damage_visitor &v) const namespace era_validator { using namespace persistent_data; - uint32_t const VERSION = 1; - unsigned const SECTOR_TO_BLOCK_SHIFT = 3; uint32_t const SUPERBLOCK_CSUM_SEED = 146538381; // FIXME: turn into a template, we have 3 similar classes now diff --git a/persistent-data/data-structures/bloom_filter.cc b/persistent-data/data-structures/bloom_filter.cc index 62211f9..dabfd59 100644 --- a/persistent-data/data-structures/bloom_filter.cc +++ b/persistent-data/data-structures/bloom_filter.cc @@ -37,8 +37,7 @@ namespace { bloom_filter::bloom_filter(transaction_manager &tm, unsigned nr_bits, unsigned nr_probes) - : tm_(tm), - bits_(tm), + : bits_(tm), nr_probes_(nr_probes), mask_(nr_bits - 1) { @@ -48,8 +47,7 @@ bloom_filter::bloom_filter(transaction_manager &tm, bloom_filter::bloom_filter(transaction_manager &tm, block_address root, unsigned nr_bits, unsigned nr_probes) - : tm_(tm), - bits_(tm, root, nr_bits), + : bits_(tm, root, nr_bits), nr_probes_(nr_probes), mask_(nr_bits - 1) { diff --git a/persistent-data/data-structures/bloom_filter.h b/persistent-data/data-structures/bloom_filter.h index 09357e3..30b38e9 100644 --- a/persistent-data/data-structures/bloom_filter.h +++ b/persistent-data/data-structures/bloom_filter.h @@ -33,7 +33,6 @@ namespace persistent_data { void fill_probes(block_address b, std::vector &probes) const; - transaction_manager &tm_; persistent_data::bitset bits_; unsigned nr_probes_; uint64_t mask_; diff --git a/persistent-data/space-maps/disk.cc b/persistent-data/space-maps/disk.cc index 4492a3c..c6c9c23 100644 --- a/persistent-data/space-maps/disk.cc +++ b/persistent-data/space-maps/disk.cc @@ -586,30 +586,20 @@ namespace { class ie_value_visitor { public: - ie_value_visitor(index_entry_visitor &v) - : v_(v) { - } + ie_value_visitor(index_entry_visitor &v) {} virtual void visit(btree_path const &path, sm_disk_detail::index_entry const &ie) { // FIXME: finish } - - private: - index_entry_visitor &v_; }; class ie_damage_visitor { public: - ie_damage_visitor(index_entry_visitor &v) - : v_(v) { - } + ie_damage_visitor(index_entry_visitor &v) {} virtual void visit(btree_path const &path, btree_detail::damage const &d) { // FIXME: finish } - - private: - index_entry_visitor &v_; }; class btree_index_store : public index_store { diff --git a/thin-provisioning/superblock.cc b/thin-provisioning/superblock.cc index 3e9d609..3651707 100644 --- a/thin-provisioning/superblock.cc +++ b/thin-provisioning/superblock.cc @@ -85,8 +85,6 @@ namespace { using namespace persistent_data; using namespace superblock_detail; - uint32_t const VERSION = 1; - unsigned const SECTOR_TO_BLOCK_SHIFT = 3; uint32_t const SUPERBLOCK_CSUM_SEED = 160774; struct sb_validator : public bcache::validator {