[various] remove dead code.

Squashes warnings from clang++
This commit is contained in:
Joe Thornber 2020-04-08 12:12:59 +01:00
parent 5f2c3bed69
commit 5e347dddbf
13 changed files with 5 additions and 35 deletions

View File

@ -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)),

View File

@ -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_;

View File

@ -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_;

View File

@ -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) {

View File

@ -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_;

View File

@ -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 {

View File

@ -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) {

View File

@ -99,7 +99,6 @@ namespace {
pd::bitset::ptr bits_;
bool in_era_array_;
uint32_t nr_blocks_;
};
}

View File

@ -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

View File

@ -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)
{

View File

@ -33,7 +33,6 @@ namespace persistent_data {
void fill_probes(block_address b, std::vector<unsigned> &probes) const;
transaction_manager &tm_;
persistent_data::bitset bits_;
unsigned nr_probes_;
uint64_t mask_;

View File

@ -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 {

View File

@ -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 {