Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: add override in headers files #13962

Merged
merged 1 commit into from Mar 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/os/FuseStore.h
Expand Up @@ -36,7 +36,7 @@ class FuseStore {
FuseStore *fs;
public:
explicit FuseThread(FuseStore *f) : fs(f) {}
void *entry() {
void *entry() override {
fs->loop();
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/os/ObjectStore.h
Expand Up @@ -159,7 +159,7 @@ class ObjectStore {
) = 0; ///< @return true if idle, false otherwise

Sequencer_impl(CephContext* cct) : RefCountedObject(NULL, 0), cct(cct) {}
virtual ~Sequencer_impl() {}
~Sequencer_impl() override {}
};
typedef boost::intrusive_ptr<Sequencer_impl> Sequencer_implRef;

Expand Down
112 changes: 56 additions & 56 deletions src/os/bluestore/BitAllocator.h
Expand Up @@ -363,23 +363,23 @@ class BitMapZone: public BitMapArea{
static int64_t total_blocks;
static void incr_count() { count++;}
static int64_t get_total_blocks() {return total_blocks;}
bool is_allocated(int64_t start_block, int64_t num_blocks);
bool is_exhausted();
bool is_allocated(int64_t start_block, int64_t num_blocks) override;
bool is_exhausted() override;
void reset_marker();

int64_t sub_used_blocks(int64_t num_blocks);
int64_t add_used_blocks(int64_t num_blocks);
bool reserve_blocks(int64_t num_blocks);
void unreserve(int64_t num_blocks, int64_t allocated);
int64_t get_reserved_blocks();
int64_t get_used_blocks();
int64_t size() {
int64_t sub_used_blocks(int64_t num_blocks) override;
int64_t add_used_blocks(int64_t num_blocks) override;
bool reserve_blocks(int64_t num_blocks) override;
void unreserve(int64_t num_blocks, int64_t allocated) override;
int64_t get_reserved_blocks() override;
int64_t get_used_blocks() override;
int64_t size() override {
return get_total_blocks();
}

void lock_excl();
bool lock_excl_try();
void unlock();
void lock_excl() override;
bool lock_excl_try() override;
void unlock() override;
bool check_locked();

void free_blocks_int(int64_t start_block, int64_t num_blocks);
Expand All @@ -388,14 +388,14 @@ class BitMapZone: public BitMapArea{
BitMapZone(CephContext* cct, int64_t total_blocks, int64_t zone_num);
BitMapZone(CephContext* cct, int64_t total_blocks, int64_t zone_num, bool def);

~BitMapZone();
void shutdown();
~BitMapZone() override;
void shutdown() override;
int64_t alloc_blocks_dis(int64_t num_blocks, int64_t min_alloc, int64_t hint,
int64_t blk_off, ExtentList *block_list);
void set_blocks_used(int64_t start_block, int64_t num_blocks);
int64_t blk_off, ExtentList *block_list) override;
void set_blocks_used(int64_t start_block, int64_t num_blocks) override;

void free_blocks(int64_t start_block, int64_t num_blocks);
void dump_state(int& count);
void free_blocks(int64_t start_block, int64_t num_blocks) override;
void dump_state(int& count) override;
};

class BitMapAreaIN: public BitMapArea{
Expand All @@ -411,24 +411,24 @@ class BitMapAreaIN: public BitMapArea{
std::mutex m_blocks_lock;
BitMapAreaList *m_child_list;

virtual bool is_allocated(int64_t start_block, int64_t num_blocks);
virtual bool is_exhausted();
bool is_allocated(int64_t start_block, int64_t num_blocks) override;
bool is_exhausted() override;

bool child_check_n_lock(BitMapArea *child, int64_t required, bool lock) {
bool child_check_n_lock(BitMapArea *child, int64_t required, bool lock) override {
ceph_abort();
return false;
}

virtual bool child_check_n_lock(BitMapArea *child, int64_t required);
virtual void child_unlock(BitMapArea *child);
bool child_check_n_lock(BitMapArea *child, int64_t required) override;
void child_unlock(BitMapArea *child) override;

virtual void lock_excl() {
void lock_excl() override {
return;
}
virtual void lock_shared() {
void lock_shared() override {
return;
}
virtual void unlock() {
void unlock() override {
return;
}

Expand All @@ -447,30 +447,30 @@ class BitMapAreaIN: public BitMapArea{
BitMapAreaIN(CephContext* cct, int64_t zone_num, int64_t total_blocks,
bool def);

virtual ~BitMapAreaIN();
void shutdown();
virtual int64_t sub_used_blocks(int64_t num_blocks);
virtual int64_t add_used_blocks(int64_t num_blocks);
virtual bool reserve_blocks(int64_t num_blocks);
virtual void unreserve(int64_t num_blocks, int64_t allocated);
virtual int64_t get_reserved_blocks();
virtual int64_t get_used_blocks();
~BitMapAreaIN() override;
void shutdown() override;
int64_t sub_used_blocks(int64_t num_blocks) override;
int64_t add_used_blocks(int64_t num_blocks) override;
bool reserve_blocks(int64_t num_blocks) override;
void unreserve(int64_t num_blocks, int64_t allocated) override;
int64_t get_reserved_blocks() override;
int64_t get_used_blocks() override;
virtual int64_t get_used_blocks_adj();
virtual int64_t size() {
int64_t size() override {
return m_total_blocks;
}
using BitMapArea::alloc_blocks_dis; //non-wait version

virtual int64_t alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc, int64_t hint,
int64_t blk_off, ExtentList *block_list);
virtual int64_t alloc_blocks_dis(int64_t num_blocks, int64_t min_alloc, int64_t hint,
int64_t blk_off, ExtentList *block_list);
int64_t blk_off, ExtentList *block_list);
int64_t alloc_blocks_dis(int64_t num_blocks, int64_t min_alloc, int64_t hint,
int64_t blk_off, ExtentList *block_list) override;
virtual void set_blocks_used_int(int64_t start_block, int64_t num_blocks);
virtual void set_blocks_used(int64_t start_block, int64_t num_blocks);
void set_blocks_used(int64_t start_block, int64_t num_blocks) override;

virtual void free_blocks_int(int64_t start_block, int64_t num_blocks);
virtual void free_blocks(int64_t start_block, int64_t num_blocks);
void dump_state(int& count);
void free_blocks(int64_t start_block, int64_t num_blocks) override;
void dump_state(int& count) override;
};

class BitMapAreaLeaf: public BitMapAreaIN{
Expand All @@ -489,7 +489,7 @@ class BitMapAreaLeaf: public BitMapAreaIN{
bool def);

using BitMapAreaIN::child_check_n_lock;
bool child_check_n_lock(BitMapArea *child, int64_t required) {
bool child_check_n_lock(BitMapArea *child, int64_t required) override {
ceph_abort();
return false;
}
Expand All @@ -498,10 +498,10 @@ class BitMapAreaLeaf: public BitMapAreaIN{

int64_t alloc_blocks_int(int64_t num_blocks, int64_t hint, int64_t *start_block);
int64_t alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc, int64_t hint,
int64_t blk_off, ExtentList *block_list);
void free_blocks_int(int64_t start_block, int64_t num_blocks);
int64_t blk_off, ExtentList *block_list) override;
void free_blocks_int(int64_t start_block, int64_t num_blocks) override;

virtual ~BitMapAreaLeaf();
~BitMapAreaLeaf() override;
};


Expand All @@ -524,16 +524,16 @@ class BitAllocator:public BitMapAreaIN{
}

using BitMapArea::child_check_n_lock;
bool child_check_n_lock(BitMapArea *child, int64_t required);
virtual void child_unlock(BitMapArea *child);
bool child_check_n_lock(BitMapArea *child, int64_t required) override;
void child_unlock(BitMapArea *child) override;

void serial_lock();
bool try_serial_lock();
void serial_unlock();
void lock_excl();
void lock_shared();
void lock_excl() override;
void lock_shared() override;
bool try_lock();
void unlock();
void unlock() override;

bool check_input(int64_t num_blocks);
bool check_input_dis(int64_t num_blocks);
Expand All @@ -542,7 +542,7 @@ class BitAllocator:public BitMapAreaIN{
int64_t alloc_blocks_dis_work(int64_t num_blocks, int64_t min_alloc, int64_t hint, ExtentList *block_list, bool reserved);

int64_t alloc_blocks_dis_int(int64_t num_blocks, int64_t min_alloc,
int64_t hint, int64_t area_blk_off, ExtentList *block_list);
int64_t hint, int64_t area_blk_off, ExtentList *block_list) override;

public:
MEMPOOL_CLASS_HELPERS();
Expand All @@ -553,12 +553,12 @@ class BitAllocator:public BitMapAreaIN{
bmap_alloc_mode_t mode, bool def);
BitAllocator(CephContext* cct, int64_t total_blocks, int64_t zone_size_block,
bmap_alloc_mode_t mode, bool def, bool stats_on);
~BitAllocator();
void shutdown();
~BitAllocator() override;
void shutdown() override;
using BitMapAreaIN::alloc_blocks_dis; //Wait version

void free_blocks(int64_t start_block, int64_t num_blocks);
void set_blocks_used(int64_t start_block, int64_t num_blocks);
void free_blocks(int64_t start_block, int64_t num_blocks) override;
void set_blocks_used(int64_t start_block, int64_t num_blocks) override;
void unreserve_blocks(int64_t blocks);

int64_t alloc_blocks_dis_res(int64_t num_blocks, int64_t min_alloc, int64_t hint, ExtentList *block_list);
Expand All @@ -569,7 +569,7 @@ class BitAllocator:public BitMapAreaIN{
int64_t total_blocks() const {
return m_total_blocks - m_extra_blocks;
}
int64_t get_used_blocks() {
int64_t get_used_blocks() override {
return (BitMapAreaIN::get_used_blocks_adj() - m_extra_blocks);
}

Expand Down
2 changes: 1 addition & 1 deletion src/os/bluestore/BitMapAllocator.h
Expand Up @@ -26,7 +26,7 @@ class BitMapAllocator : public Allocator {

public:
BitMapAllocator(CephContext* cct, int64_t device_size, int64_t block_size);
~BitMapAllocator();
~BitMapAllocator() override;

int reserve(uint64_t need) override;
void unreserve(uint64_t unused) override;
Expand Down
2 changes: 1 addition & 1 deletion src/os/bluestore/BlueFS.h
Expand Up @@ -75,7 +75,7 @@ class BlueFS {
num_writers(0),
num_reading(0)
{}
~File() {
~File() override {
assert(num_readers.load() == 0);
assert(num_writers.load() == 0);
assert(num_reading.load() == 0);
Expand Down
8 changes: 4 additions & 4 deletions src/os/bluestore/BlueRocksEnv.cc
Expand Up @@ -30,7 +30,7 @@ class BlueRocksSequentialFile : public rocksdb::SequentialFile {
BlueFS::FileReader *h;
public:
BlueRocksSequentialFile(BlueFS *fs, BlueFS::FileReader *h) : fs(fs), h(h) {}
~BlueRocksSequentialFile() {
~BlueRocksSequentialFile() override {
delete h;
}

Expand Down Expand Up @@ -76,7 +76,7 @@ class BlueRocksRandomAccessFile : public rocksdb::RandomAccessFile {
BlueFS::FileReader *h;
public:
BlueRocksRandomAccessFile(BlueFS *fs, BlueFS::FileReader *h) : fs(fs), h(h) {}
~BlueRocksRandomAccessFile() {
~BlueRocksRandomAccessFile() override {
delete h;
}

Expand Down Expand Up @@ -154,7 +154,7 @@ class BlueRocksWritableFile : public rocksdb::WritableFile {
BlueFS::FileWriter *h;
public:
BlueRocksWritableFile(BlueFS *fs, BlueFS::FileWriter *h) : fs(fs), h(h) {}
~BlueRocksWritableFile() {
~BlueRocksWritableFile() override {
fs->close_writer(h);
}

Expand Down Expand Up @@ -306,7 +306,7 @@ class BlueRocksFileLock : public rocksdb::FileLock {
BlueFS *fs;
BlueFS::FileLock *lock;
BlueRocksFileLock(BlueFS *fs, BlueFS::FileLock *l) : fs(fs), lock(l) { }
~BlueRocksFileLock() {
~BlueRocksFileLock() override {
}
};

Expand Down