From: liuchang0812 Date: Wed, 22 Feb 2017 11:43:11 +0000 (+0800) Subject: osd: add override in headers files X-Git-Tag: v12.0.2~311^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=acec741706ba6e43f63912ac7a7ba854fc9e12f5;p=ceph.git osd: add override in headers files Signed-off-by: liuchang0812 --- diff --git a/src/os/FuseStore.h b/src/os/FuseStore.h index 04681e645c20..db39ca5ef40d 100644 --- a/src/os/FuseStore.h +++ b/src/os/FuseStore.h @@ -36,7 +36,7 @@ public: FuseStore *fs; public: explicit FuseThread(FuseStore *f) : fs(f) {} - void *entry() { + void *entry() override { fs->loop(); return NULL; } diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 2a9c28777471..34f28875d1da 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -159,7 +159,7 @@ public: ) = 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_implRef; diff --git a/src/os/bluestore/BitAllocator.h b/src/os/bluestore/BitAllocator.h index 730cfd0c9a99..9f684251b5d1 100644 --- a/src/os/bluestore/BitAllocator.h +++ b/src/os/bluestore/BitAllocator.h @@ -363,23 +363,23 @@ public: 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); @@ -388,14 +388,14 @@ public: 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{ @@ -411,24 +411,24 @@ protected: 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; } @@ -447,30 +447,30 @@ public: 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{ @@ -489,7 +489,7 @@ public: 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; } @@ -498,10 +498,10 @@ public: 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; }; @@ -524,16 +524,16 @@ private: } 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); @@ -542,7 +542,7 @@ private: 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(); @@ -553,12 +553,12 @@ public: 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); @@ -569,7 +569,7 @@ public: 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); } diff --git a/src/os/bluestore/BitMapAllocator.h b/src/os/bluestore/BitMapAllocator.h index 354dc17af3be..17bb2560394b 100644 --- a/src/os/bluestore/BitMapAllocator.h +++ b/src/os/bluestore/BitMapAllocator.h @@ -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; diff --git a/src/os/bluestore/BlueFS.h b/src/os/bluestore/BlueFS.h index d8808c00d12d..bf2dcf518e12 100644 --- a/src/os/bluestore/BlueFS.h +++ b/src/os/bluestore/BlueFS.h @@ -75,7 +75,7 @@ public: num_writers(0), num_reading(0) {} - ~File() { + ~File() override { assert(num_readers.load() == 0); assert(num_writers.load() == 0); assert(num_reading.load() == 0); diff --git a/src/os/bluestore/BlueRocksEnv.cc b/src/os/bluestore/BlueRocksEnv.cc index ff5aaa6f1112..3fcccc861dd3 100644 --- a/src/os/bluestore/BlueRocksEnv.cc +++ b/src/os/bluestore/BlueRocksEnv.cc @@ -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; } @@ -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; } @@ -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); } @@ -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 { } }; diff --git a/src/os/bluestore/BlueRocksEnv.h b/src/os/bluestore/BlueRocksEnv.h index 463cbf460dcb..555c6964f5c5 100644 --- a/src/os/bluestore/BlueRocksEnv.h +++ b/src/os/bluestore/BlueRocksEnv.h @@ -32,7 +32,7 @@ public: rocksdb::Status NewSequentialFile( const std::string& fname, std::unique_ptr* result, - const rocksdb::EnvOptions& options); + const rocksdb::EnvOptions& options) override; // Create a brand new random access read-only file with the // specified name. On success, stores a pointer to the new file in @@ -44,7 +44,7 @@ public: rocksdb::Status NewRandomAccessFile( const std::string& fname, std::unique_ptr* result, - const rocksdb::EnvOptions& options); + const rocksdb::EnvOptions& options) override; // Create an object that writes to a new file with the specified // name. Deletes any existing file with the same name and creates a @@ -56,14 +56,14 @@ public: rocksdb::Status NewWritableFile( const std::string& fname, std::unique_ptr* result, - const rocksdb::EnvOptions& options); + const rocksdb::EnvOptions& options) override; // Reuse an existing file by renaming it and opening it as writable. rocksdb::Status ReuseWritableFile( const std::string& fname, const std::string& old_fname, std::unique_ptr* result, - const rocksdb::EnvOptions& options); + const rocksdb::EnvOptions& options) override; // Create an object that represents a directory. Will fail if directory // doesn't exist. If the directory exists, it will open the directory @@ -74,45 +74,45 @@ public: // returns non-OK. rocksdb::Status NewDirectory( const std::string& name, - std::unique_ptr* result); + std::unique_ptr* result) override; // Returns OK if the named file exists. // NotFound if the named file does not exist, // the calling process does not have permission to determine // whether this file exists, or if the path is invalid. // IOError if an IO Error was encountered - rocksdb::Status FileExists(const std::string& fname); + rocksdb::Status FileExists(const std::string& fname) override; // Store in *result the names of the children of the specified directory. // The names are relative to "dir". // Original contents of *results are dropped. rocksdb::Status GetChildren(const std::string& dir, - std::vector* result); + std::vector* result) override; // Delete the named file. - rocksdb::Status DeleteFile(const std::string& fname); + rocksdb::Status DeleteFile(const std::string& fname) override; // Create the specified directory. Returns error if directory exists. - rocksdb::Status CreateDir(const std::string& dirname); + rocksdb::Status CreateDir(const std::string& dirname) override; // Create directory if missing. Return Ok if it exists, or successful in // Creating. - rocksdb::Status CreateDirIfMissing(const std::string& dirname); + rocksdb::Status CreateDirIfMissing(const std::string& dirname) override; // Delete the specified directory. - rocksdb::Status DeleteDir(const std::string& dirname); + rocksdb::Status DeleteDir(const std::string& dirname) override; // Store the size of fname in *file_size. - rocksdb::Status GetFileSize(const std::string& fname, uint64_t* file_size); + rocksdb::Status GetFileSize(const std::string& fname, uint64_t* file_size) override; // Store the last modification time of fname in *file_mtime. rocksdb::Status GetFileModificationTime(const std::string& fname, - uint64_t* file_mtime); + uint64_t* file_mtime) override; // Rename file src to target. rocksdb::Status RenameFile(const std::string& src, - const std::string& target); + const std::string& target) override; // Hard Link file src to target. - rocksdb::Status LinkFile(const std::string& src, const std::string& target); + rocksdb::Status LinkFile(const std::string& src, const std::string& target) override; // Lock the specified file. Used to prevent concurrent access to // the same db by multiple processes. On failure, stores nullptr in @@ -128,27 +128,27 @@ public: // to go away. // // May create the named file if it does not already exist. - rocksdb::Status LockFile(const std::string& fname, rocksdb::FileLock** lock); + rocksdb::Status LockFile(const std::string& fname, rocksdb::FileLock** lock) override; // Release the lock acquired by a previous successful call to LockFile. // REQUIRES: lock was returned by a successful LockFile() call // REQUIRES: lock has not already been unlocked. - rocksdb::Status UnlockFile(rocksdb::FileLock* lock); + rocksdb::Status UnlockFile(rocksdb::FileLock* lock) override; // *path is set to a temporary directory that can be used for testing. It may // or may not have just been created. The directory may or may not differ // between runs of the same process, but subsequent calls will return the // same directory. - rocksdb::Status GetTestDirectory(std::string* path); + rocksdb::Status GetTestDirectory(std::string* path) override; // Create and return a log file for storing informational messages. rocksdb::Status NewLogger( const std::string& fname, - std::shared_ptr* result); + std::shared_ptr* result) override; // Get full directory name for this db. rocksdb::Status GetAbsolutePath(const std::string& db_path, - std::string* output_path); + std::string* output_path) override; explicit BlueRocksEnv(BlueFS *f); private: diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 04cb5536e5f9..cfed361d566c 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -115,8 +115,8 @@ class BlueStore : public ObjectStore, // types public: // config observer - virtual const char** get_tracked_conf_keys() const override; - virtual void handle_conf_change(const struct md_config_t *conf, + const char** get_tracked_conf_keys() const override; + void handle_conf_change(const struct md_config_t *conf, const std::set &changed) override; void _set_csum(); @@ -1319,14 +1319,14 @@ public: string head, tail; public: OmapIteratorImpl(CollectionRef c, OnodeRef o, KeyValueDB::Iterator it); - int seek_to_first(); - int upper_bound(const string &after); - int lower_bound(const string &to); - bool valid(); - int next(bool validate=true); - string key(); - bufferlist value(); - int status() { + int seek_to_first() override; + int upper_bound(const string &after) override; + int lower_bound(const string &to) override; + bool valid() override; + int next(bool validate=true) override; + string key() override; + bufferlist value() override; + int status() override { return 0; } }; @@ -1558,7 +1558,7 @@ public: parent(NULL), store(store) { store->register_osr(this); } - ~OpSequencer() { + ~OpSequencer() override { assert(q.empty()); _unregister(); } @@ -1647,7 +1647,7 @@ public: struct KVSyncThread : public Thread { BlueStore *store; explicit KVSyncThread(BlueStore *s) : store(s) {} - void *entry() { + void *entry() override { store->_kv_sync_thread(); return NULL; } @@ -1780,7 +1780,7 @@ private: explicit MempoolThread(BlueStore *s) : store(s), lock("BlueStore::MempoolThread::lock") {} - void *entry(); + void *entry() override; void init() { assert(stop == false); create("bstore_mempool"); @@ -1942,7 +1942,7 @@ private: public: BlueStore(CephContext *cct, const string& path); BlueStore(CephContext *cct, const string& path, uint64_t min_alloc_size); // Ctor for UT only - ~BlueStore(); + ~BlueStore() override; string get_type() override { return "bluestore"; @@ -2175,7 +2175,7 @@ public: perf_tracker.update_from_perfcounters(*logger); return perf_tracker.get_cur_stats(); } - const PerfCounters* get_perf_counters() const { + const PerfCounters* get_perf_counters() const override { return logger; } diff --git a/src/os/bluestore/KernelDevice.h b/src/os/bluestore/KernelDevice.h index 77ca32672eac..e1d145fef616 100644 --- a/src/os/bluestore/KernelDevice.h +++ b/src/os/bluestore/KernelDevice.h @@ -44,7 +44,7 @@ class KernelDevice : public BlockDevice { struct AioCompletionThread : public Thread { KernelDevice *bdev; explicit AioCompletionThread(KernelDevice *b) : bdev(b) {} - void *entry() { + void *entry() override { bdev->_aio_thread(); return NULL; } diff --git a/src/os/bluestore/StupidAllocator.h b/src/os/bluestore/StupidAllocator.h index 6cd93eca73ec..445e8a6bc8a1 100644 --- a/src/os/bluestore/StupidAllocator.h +++ b/src/os/bluestore/StupidAllocator.h @@ -26,7 +26,7 @@ class StupidAllocator : public Allocator { public: StupidAllocator(CephContext* cct); - ~StupidAllocator(); + ~StupidAllocator() override; int reserve(uint64_t need) override; void unreserve(uint64_t unused) override; diff --git a/src/os/filestore/BtrfsFileStoreBackend.h b/src/os/filestore/BtrfsFileStoreBackend.h index 2933eb1949ca..0794be2d364d 100644 --- a/src/os/filestore/BtrfsFileStoreBackend.h +++ b/src/os/filestore/BtrfsFileStoreBackend.h @@ -30,20 +30,20 @@ private: bool m_filestore_btrfs_snap; public: explicit BtrfsFileStoreBackend(FileStore *fs); - ~BtrfsFileStoreBackend() {} - const char *get_name() { + ~BtrfsFileStoreBackend() override {} + const char *get_name() override { return "btrfs"; } - int detect_features(); - bool can_checkpoint(); - int create_current(); - int list_checkpoints(list& ls); - int create_checkpoint(const string& name, uint64_t *cid); - int sync_checkpoint(uint64_t cid); - int rollback_to(const string& name); - int destroy_checkpoint(const string& name); - int syncfs(); - int clone_range(int from, int to, uint64_t srcoff, uint64_t len, uint64_t dstoff); + int detect_features() override; + bool can_checkpoint() override; + int create_current() override; + int list_checkpoints(list& ls) override; + int create_checkpoint(const string& name, uint64_t *cid) override; + int sync_checkpoint(uint64_t cid) override; + int rollback_to(const string& name) override; + int destroy_checkpoint(const string& name) override; + int syncfs() override; + int clone_range(int from, int to, uint64_t srcoff, uint64_t len, uint64_t dstoff) override; }; #endif #endif diff --git a/src/os/filestore/DBObjectMap.h b/src/os/filestore/DBObjectMap.h index 2fb411d753cf..f65e2b600f38 100644 --- a/src/os/filestore/DBObjectMap.h +++ b/src/os/filestore/DBObjectMap.h @@ -125,86 +125,86 @@ public: const ghobject_t &oid, const map &set, const SequencerPosition *spos=0 - ); + ) override; int set_header( const ghobject_t &oid, const bufferlist &bl, const SequencerPosition *spos=0 - ); + ) override; int get_header( const ghobject_t &oid, bufferlist *bl - ); + ) override; int clear( const ghobject_t &oid, const SequencerPosition *spos=0 - ); + ) override; int clear_keys_header( const ghobject_t &oid, const SequencerPosition *spos=0 - ); + ) override; int rm_keys( const ghobject_t &oid, const set &to_clear, const SequencerPosition *spos=0 - ); + ) override; int get( const ghobject_t &oid, bufferlist *header, map *out - ); + ) override; int get_keys( const ghobject_t &oid, set *keys - ); + ) override; int get_values( const ghobject_t &oid, const set &keys, map *out - ); + ) override; int check_keys( const ghobject_t &oid, const set &keys, set *out - ); + ) override; int get_xattrs( const ghobject_t &oid, const set &to_get, map *out - ); + ) override; int get_all_xattrs( const ghobject_t &oid, set *out - ); + ) override; int set_xattrs( const ghobject_t &oid, const map &to_set, const SequencerPosition *spos=0 - ); + ) override; int remove_xattrs( const ghobject_t &oid, const set &to_remove, const SequencerPosition *spos=0 - ); + ) override; int clone( const ghobject_t &oid, const ghobject_t &target, const SequencerPosition *spos=0 - ); + ) override; /// Read initial state from backing store int init(bool upgrade = false); @@ -213,16 +213,16 @@ public: int upgrade_to_v2(); /// Consistency check, debug, there must be no parallel writes - bool check(std::ostream &out); + bool check(std::ostream &out) override; /// Ensure that all previous operations are durable - int sync(const ghobject_t *oid=0, const SequencerPosition *spos=0); + int sync(const ghobject_t *oid=0, const SequencerPosition *spos=0) override; /// Util, list all objects, there must be no other concurrent access int list_objects(vector *objs ///< [out] objects ); - ObjectMapIterator get_iterator(const ghobject_t &oid); + ObjectMapIterator get_iterator(const ghobject_t &oid) override; static const string USER_PREFIX; static const string XATTR_PREFIX; @@ -346,15 +346,15 @@ private: class EmptyIteratorImpl : public ObjectMapIteratorImpl { public: - int seek_to_first() { return 0; } + int seek_to_first() override { return 0; } int seek_to_last() { return 0; } - int upper_bound(const string &after) { return 0; } - int lower_bound(const string &to) { return 0; } - bool valid() { return false; } - int next(bool validate=true) { ceph_abort(); return 0; } - string key() { ceph_abort(); return ""; } - bufferlist value() { ceph_abort(); return bufferlist(); } - int status() { return 0; } + int upper_bound(const string &after) override { return 0; } + int lower_bound(const string &to) override { return 0; } + bool valid() override { return false; } + int next(bool validate=true) override { ceph_abort(); return 0; } + string key() override { ceph_abort(); return ""; } + bufferlist value() override { ceph_abort(); return bufferlist(); } + int status() override { return 0; } }; @@ -384,15 +384,15 @@ private: DBObjectMapIteratorImpl(DBObjectMap *map, Header header) : map(map), hlock(map), header(header), r(0), ready(false), invalid(true) {} - int seek_to_first(); + int seek_to_first() override; int seek_to_last(); - int upper_bound(const string &after); - int lower_bound(const string &to); - bool valid(); - int next(bool validate=true); - string key(); - bufferlist value(); - int status(); + int upper_bound(const string &after) override; + int lower_bound(const string &to) override; + bool valid() override; + int next(bool validate=true) override; + string key() override; + bufferlist value() override; + int status() override; bool on_parent() { return cur_iter == parent_iter; diff --git a/src/os/filestore/FDCache.h b/src/os/filestore/FDCache.h index 4fdb8409db21..8e037ac78a12 100644 --- a/src/os/filestore/FDCache.h +++ b/src/os/filestore/FDCache.h @@ -66,7 +66,7 @@ public: MAX((cct->_conf->filestore_fd_cache_size / registry_shards), 1)); } } - ~FDCache() { + ~FDCache() override { cct->_conf->remove_observer(this); delete[] registry; } @@ -89,7 +89,7 @@ public: } /// md_config_obs_t - const char** get_tracked_conf_keys() const { + const char** get_tracked_conf_keys() const override { static const char* KEYS[] = { "filestore_fd_cache_size", NULL @@ -97,7 +97,7 @@ public: return KEYS; } void handle_conf_change(const md_config_t *conf, - const std::set &changed) { + const std::set &changed) override { if (changed.count("filestore_fd_cache_size")) { for (int i = 0; i < registry_shards; ++i) registry[i].set_size( diff --git a/src/os/filestore/FileJournal.h b/src/os/filestore/FileJournal.h index 095d4883b17a..67c4f03fd208 100644 --- a/src/os/filestore/FileJournal.h +++ b/src/os/filestore/FileJournal.h @@ -102,11 +102,11 @@ public: completions.pop_front(); } - int prepare_entry(vector& tls, bufferlist* tbl); + int prepare_entry(vector& tls, bufferlist* tbl) override; void submit_entry(uint64_t seq, bufferlist& bl, uint32_t orig_len, Context *oncommit, - TrackedOpRef osd_op = TrackedOpRef()); + TrackedOpRef osd_op = TrackedOpRef()) override; /// End protected by finisher_lock /* @@ -366,7 +366,7 @@ private: FileJournal *journal; public: explicit Writer(FileJournal *fj) : journal(fj) {} - void *entry() { + void *entry() override { journal->write_thread_entry(); return 0; } @@ -376,7 +376,7 @@ private: FileJournal *journal; public: explicit WriteFinisher(FileJournal *fj) : journal(fj) {} - void *entry() { + void *entry() override { journal->write_finish_thread_entry(); return 0; } @@ -435,35 +435,35 @@ private: cct->_conf->add_observer(this); } - ~FileJournal() { + ~FileJournal() override { assert(fd == -1); delete[] zero_buf; cct->_conf->remove_observer(this); } - int check(); - int create(); - int open(uint64_t fs_op_seq); - void close(); + int check() override; + int create() override; + int open(uint64_t fs_op_seq) override; + void close() override; int peek_fsid(uuid_d& fsid); - int dump(ostream& out); + int dump(ostream& out) override; int simple_dump(ostream& out); int _fdump(Formatter &f, bool simple); - void flush(); + void flush() override; - void reserve_throttle_and_backoff(uint64_t count); + void reserve_throttle_and_backoff(uint64_t count) override; - bool is_writeable() { + bool is_writeable() override { return read_pos == 0; } - int make_writeable(); + int make_writeable() override; // writes - void commit_start(uint64_t seq); - void committed_thru(uint64_t seq); - bool should_commit_now() { + void commit_start(uint64_t seq) override; + void committed_thru(uint64_t seq) override; + bool should_commit_now() override { return full_state != FULL_NOTFULL && !write_stop; } @@ -513,7 +513,7 @@ private: bool read_entry( bufferlist &bl, - uint64_t &last_seq) { + uint64_t &last_seq) override { return read_entry(bl, last_seq, 0); } diff --git a/src/os/filestore/FileStore.h b/src/os/filestore/FileStore.h index a81d7508bc9f..a67c79f12a8a 100644 --- a/src/os/filestore/FileStore.h +++ b/src/os/filestore/FileStore.h @@ -137,11 +137,11 @@ public: void update_from_perfcounters(PerfCounters &logger); } perf_tracker; - objectstore_perf_stat_t get_cur_stats() { + objectstore_perf_stat_t get_cur_stats() override { perf_tracker.update_from_perfcounters(*logger); return perf_tracker.get_cur_stats(); } - const PerfCounters* get_perf_counters() const { + const PerfCounters* get_perf_counters() const override { return logger; } @@ -202,7 +202,7 @@ private: struct SyncThread : public Thread { FileStore *fs; explicit SyncThread(FileStore *f) : fs(f) {} - void *entry() { + void *entry() override { fs->sync_entry(); return 0; } @@ -309,7 +309,7 @@ private: return o; } - void flush() { + void flush() override { Mutex::Locker l(qlock); while (cct->_conf->filestore_blackhole) @@ -330,7 +330,7 @@ private: cond.Wait(qlock); } } - bool flush_commit(Context *c) { + bool flush_commit(Context *c) override { Mutex::Locker l(qlock); uint64_t seq = 0; if (_get_max_uncompleted(&seq)) { @@ -347,7 +347,7 @@ private: parent(0), apply_lock("FileStore::OpSequencer::apply_lock", false, false), id(i) {} - ~OpSequencer() { + ~OpSequencer() override { assert(q.empty()); } @@ -376,17 +376,17 @@ private: OpWQ(FileStore *fs, time_t timeout, time_t suicide_timeout, ThreadPool *tp) : ThreadPool::WorkQueue("FileStore::OpWQ", timeout, suicide_timeout, tp), store(fs) {} - bool _enqueue(OpSequencer *osr) { + bool _enqueue(OpSequencer *osr) override { store->op_queue.push_back(osr); return true; } - void _dequeue(OpSequencer *o) { + void _dequeue(OpSequencer *o) override { ceph_abort(); } - bool _empty() { + bool _empty() override { return store->op_queue.empty(); } - OpSequencer *_dequeue() { + OpSequencer *_dequeue() override { if (store->op_queue.empty()) return NULL; OpSequencer *osr = store->op_queue.front(); @@ -396,10 +396,10 @@ private: void _process(OpSequencer *osr, ThreadPool::TPHandle &handle) override { store->_do_op(osr, handle); } - void _process_finish(OpSequencer *osr) { + void _process_finish(OpSequencer *osr) override { store->_finish_op(osr); } - void _clear() { + void _clear() override { assert(store->op_queue.empty()); } } op_wq; @@ -440,37 +440,37 @@ public: FileStore(CephContext* cct, const std::string &base, const std::string &jdev, osflagbits_t flags = 0, const char *internal_name = "filestore", bool update_to=false); - ~FileStore(); + ~FileStore() override; - string get_type() { + string get_type() override { return "filestore"; } int _detect_fs(); int _sanity_check_fs(); - bool test_mount_in_use(); + bool test_mount_in_use() override; int read_op_seq(uint64_t *seq); int write_op_seq(int, uint64_t seq); - int mount(); - int umount(); + int mount() override; + int umount() override; int validate_hobject_key(const hobject_t &obj) const override; - unsigned get_max_attr_name_length() { + unsigned get_max_attr_name_length() override { // xattr limit is 128; leave room for our prefixes (user.ceph._), // some margin, and cap at 100 return 100; } - int mkfs(); - int mkjournal(); - bool wants_journal() { + int mkfs() override; + int mkjournal() override; + bool wants_journal() override { return true; } - bool allows_journal() { + bool allows_journal() override { return true; } - bool needs_journal() { + bool needs_journal() override { return false; } void dump_perf_counters(Formatter *f) override { @@ -482,20 +482,20 @@ public: int write_version_stamp(); int version_stamp_is_valid(uint32_t *version); int update_version_stamp(); - int upgrade(); + int upgrade() override; - bool can_sort_nibblewise() { + bool can_sort_nibblewise() override { return true; // i support legacy sort order } - void collect_metadata(map *pm); + void collect_metadata(map *pm) override; int statfs(struct store_statfs_t *buf) override; int _do_transactions( vector &tls, uint64_t op_seq, ThreadPool::TPHandle *handle); - int do_transactions(vector &tls, uint64_t op_seq) { + int do_transactions(vector &tls, uint64_t op_seq) override { return _do_transactions(tls, op_seq, 0); } void _do_transaction( @@ -504,7 +504,7 @@ public: int queue_transactions(Sequencer *osr, vector& tls, TrackedOpRef op = TrackedOpRef(), - ThreadPool::TPHandle *handle = NULL); + ThreadPool::TPHandle *handle = NULL) override; /** * set replay guard xattr on given file @@ -557,17 +557,17 @@ public: return 0; } using ObjectStore::exists; - bool exists(const coll_t& cid, const ghobject_t& oid); + bool exists(const coll_t& cid, const ghobject_t& oid) override; using ObjectStore::stat; int stat( const coll_t& cid, const ghobject_t& oid, struct stat *st, - bool allow_eio = false); + bool allow_eio = false) override; using ObjectStore::set_collection_opts; int set_collection_opts( const coll_t& cid, - const pool_opts_t& opts); + const pool_opts_t& opts) override; using ObjectStore::read; int read( const coll_t& cid, @@ -576,13 +576,13 @@ public: size_t len, bufferlist& bl, uint32_t op_flags = 0, - bool allow_eio = false); + bool allow_eio = false) override; int _do_fiemap(int fd, uint64_t offset, size_t len, map *m); int _do_seek_hole_data(int fd, uint64_t offset, size_t len, map *m); using ObjectStore::fiemap; - int fiemap(const coll_t& cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl); + int fiemap(const coll_t& cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl) override; int _touch(const coll_t& cid, const ghobject_t& oid); int _write(const coll_t& cid, const ghobject_t& oid, uint64_t offset, size_t len, @@ -612,33 +612,33 @@ public: void flush(); void sync_and_flush(); - int flush_journal(); - int dump_journal(ostream& out); + int flush_journal() override; + int dump_journal(ostream& out) override; - void set_fsid(uuid_d u) { + void set_fsid(uuid_d u) override { fsid = u; } - uuid_d get_fsid() { return fsid; } + uuid_d get_fsid() override { return fsid; } - uint64_t estimate_objects_overhead(uint64_t num_objects); + uint64_t estimate_objects_overhead(uint64_t num_objects) override; // DEBUG read error injection, an object is removed from both on delete() Mutex read_error_lock; set data_error_set; // read() will return -EIO set mdata_error_set; // getattr(),stat() will return -EIO - void inject_data_error(const ghobject_t &oid); - void inject_mdata_error(const ghobject_t &oid); + void inject_data_error(const ghobject_t &oid) override; + void inject_mdata_error(const ghobject_t &oid) override; void debug_obj_on_delete(const ghobject_t &oid); bool debug_data_eio(const ghobject_t &oid); bool debug_mdata_eio(const ghobject_t &oid); - int snapshot(const string& name); + int snapshot(const string& name) override; // attrs using ObjectStore::getattr; using ObjectStore::getattrs; - int getattr(const coll_t& cid, const ghobject_t& oid, const char *name, bufferptr &bp); - int getattrs(const coll_t& cid, const ghobject_t& oid, map& aset); + int getattr(const coll_t& cid, const ghobject_t& oid, const char *name, bufferptr &bp) override; + int getattrs(const coll_t& cid, const ghobject_t& oid, map& aset) override; int _setattrs(const coll_t& cid, const ghobject_t& oid, map& aset, const SequencerPosition &spos); @@ -654,33 +654,33 @@ public: using ObjectStore::collection_list; int collection_list(const coll_t& c, const ghobject_t& start, const ghobject_t& end, int max, - vector *ls, ghobject_t *next); - int list_collections(vector& ls); + vector *ls, ghobject_t *next) override; + int list_collections(vector& ls) override; int list_collections(vector& ls, bool include_temp); int collection_stat(const coll_t& c, struct stat *st); - bool collection_exists(const coll_t& c); - int collection_empty(const coll_t& c, bool *empty); + bool collection_exists(const coll_t& c) override; + int collection_empty(const coll_t& c, bool *empty) override; // omap (see ObjectStore.h for documentation) using ObjectStore::omap_get; int omap_get(const coll_t& c, const ghobject_t &oid, bufferlist *header, - map *out); + map *out) override; using ObjectStore::omap_get_header; int omap_get_header( const coll_t& c, const ghobject_t &oid, bufferlist *out, - bool allow_eio = false); + bool allow_eio = false) override; using ObjectStore::omap_get_keys; - int omap_get_keys(const coll_t& c, const ghobject_t &oid, set *keys); + int omap_get_keys(const coll_t& c, const ghobject_t &oid, set *keys) override; using ObjectStore::omap_get_values; int omap_get_values(const coll_t& c, const ghobject_t &oid, const set &keys, - map *out); + map *out) override; using ObjectStore::omap_check_keys; int omap_check_keys(const coll_t& c, const ghobject_t &oid, const set &keys, - set *out); + set *out) override; using ObjectStore::get_omap_iterator; - ObjectMap::ObjectMapIterator get_omap_iterator(const coll_t& c, const ghobject_t &oid); + ObjectMap::ObjectMapIterator get_omap_iterator(const coll_t& c, const ghobject_t &oid) override; int _create_collection(const coll_t& c, const SequencerPosition &spos); int _destroy_collection(const coll_t& c); @@ -736,9 +736,9 @@ private: coll_t dest, const SequencerPosition &spos); - virtual const char** get_tracked_conf_keys() const; - virtual void handle_conf_change(const struct md_config_t *conf, - const std::set &changed); + const char** get_tracked_conf_keys() const override; + void handle_conf_change(const struct md_config_t *conf, + const std::set &changed) override; int set_throttle_params(); float m_filestore_commit_timeout; bool m_filestore_journal_parallel; diff --git a/src/os/filestore/GenericFileStoreBackend.h b/src/os/filestore/GenericFileStoreBackend.h index 74b8360419d6..df5d1acf3076 100644 --- a/src/os/filestore/GenericFileStoreBackend.h +++ b/src/os/filestore/GenericFileStoreBackend.h @@ -30,38 +30,38 @@ private: bool m_filestore_splice; public: explicit GenericFileStoreBackend(FileStore *fs); - virtual ~GenericFileStoreBackend() {} + ~GenericFileStoreBackend() override {} - virtual const char *get_name() { + const char *get_name() override { return "generic"; } - virtual int detect_features(); - virtual int create_current(); - virtual bool can_checkpoint() { return false; } - virtual int list_checkpoints(list& ls) { return 0; } - virtual int create_checkpoint(const string& name, uint64_t *cid) { return -EOPNOTSUPP; } - virtual int sync_checkpoint(uint64_t id) { return -EOPNOTSUPP; } - virtual int rollback_to(const string& name) { return -EOPNOTSUPP; } - virtual int destroy_checkpoint(const string& name) { return -EOPNOTSUPP; } - virtual int syncfs(); - virtual bool has_fiemap() { return ioctl_fiemap; } - virtual bool has_seek_data_hole() { return seek_data_hole; } - virtual int do_fiemap(int fd, off_t start, size_t len, struct fiemap **pfiemap); - virtual int clone_range(int from, int to, uint64_t srcoff, uint64_t len, uint64_t dstoff) { + int detect_features() override; + int create_current() override; + bool can_checkpoint() override { return false; } + int list_checkpoints(list& ls) override { return 0; } + int create_checkpoint(const string& name, uint64_t *cid) override { return -EOPNOTSUPP; } + int sync_checkpoint(uint64_t id) override { return -EOPNOTSUPP; } + int rollback_to(const string& name) override { return -EOPNOTSUPP; } + int destroy_checkpoint(const string& name) override { return -EOPNOTSUPP; } + int syncfs() override; + bool has_fiemap() override { return ioctl_fiemap; } + bool has_seek_data_hole() override { return seek_data_hole; } + int do_fiemap(int fd, off_t start, size_t len, struct fiemap **pfiemap) override; + int clone_range(int from, int to, uint64_t srcoff, uint64_t len, uint64_t dstoff) override { return _copy_range(from, to, srcoff, len, dstoff); } - virtual int set_alloc_hint(int fd, uint64_t hint) { return -EOPNOTSUPP; } - virtual bool has_splice() const { return use_splice; } + int set_alloc_hint(int fd, uint64_t hint) override { return -EOPNOTSUPP; } + bool has_splice() const override { return use_splice; } private: int _crc_load_or_init(int fd, SloppyCRCMap *cm); int _crc_save(int fd, SloppyCRCMap *cm); public: - virtual int _crc_update_write(int fd, loff_t off, size_t len, const bufferlist& bl); - virtual int _crc_update_truncate(int fd, loff_t off); - virtual int _crc_update_zero(int fd, loff_t off, size_t len); - virtual int _crc_update_clone_range(int srcfd, int destfd, - loff_t srcoff, size_t len, loff_t dstoff); - virtual int _crc_verify_read(int fd, loff_t off, size_t len, const bufferlist& bl, - ostream *out); + int _crc_update_write(int fd, loff_t off, size_t len, const bufferlist& bl) override; + int _crc_update_truncate(int fd, loff_t off) override; + int _crc_update_zero(int fd, loff_t off, size_t len) override; + int _crc_update_clone_range(int srcfd, int destfd, + loff_t srcoff, size_t len, loff_t dstoff) override; + int _crc_verify_read(int fd, loff_t off, size_t len, const bufferlist& bl, + ostream *out) override; }; #endif diff --git a/src/os/filestore/HashIndex.h b/src/os/filestore/HashIndex.h index 4ffde1d34ae9..f9922bcb5fa7 100644 --- a/src/os/filestore/HashIndex.h +++ b/src/os/filestore/HashIndex.h @@ -146,43 +146,43 @@ public: split_multiplier(split_multiple) {} /// @see CollectionIndex - uint32_t collection_version() { return index_version; } + uint32_t collection_version() override { return index_version; } /// @see CollectionIndex - int cleanup(); + int cleanup() override; /// @see CollectionIndex - int prep_delete(); + int prep_delete() override; /// @see CollectionIndex int _split( uint32_t match, uint32_t bits, CollectionIndex* dest - ); + ) override; /// @see CollectionIndex - virtual int apply_layout_settings(); + int apply_layout_settings() override; protected: - int _init(); + int _init() override; int _created( const vector &path, const ghobject_t &oid, const string &mangled_name - ); + ) override; int _remove( const vector &path, const ghobject_t &oid, const string &mangled_name - ); + ) override; int _lookup( const ghobject_t &oid, vector *path, string *mangled_name, int *hardlink - ); + ) override; /** * Pre-hash the collection to create folders according to the expected number @@ -191,7 +191,7 @@ protected: int _pre_hash_collection( uint32_t pg_num, uint64_t expected_num_objs - ); + ) override; int _collection_list_partial( const ghobject_t &start, @@ -199,7 +199,7 @@ protected: int max_count, vector *ls, ghobject_t *next - ); + ) override; private: /// Internal recursively remove path and its subdirs int _recursive_remove( diff --git a/src/os/filestore/JournalingObjectStore.h b/src/os/filestore/JournalingObjectStore.h index 10b66764dd26..17dc2abd7fc6 100644 --- a/src/os/filestore/JournalingObjectStore.h +++ b/src/os/filestore/JournalingObjectStore.h @@ -140,7 +140,7 @@ public: apply_manager(cct, journal, finisher), replaying(false) {} - ~JournalingObjectStore() { + ~JournalingObjectStore() override { } }; diff --git a/src/os/filestore/LFNIndex.h b/src/os/filestore/LFNIndex.h index 6cb3ed76e218..bbab0d097be0 100644 --- a/src/os/filestore/LFNIndex.h +++ b/src/os/filestore/LFNIndex.h @@ -150,40 +150,40 @@ public: } } - coll_t coll() const { return collection; } + coll_t coll() const override { return collection; } /// Virtual destructor - virtual ~LFNIndex() {} + ~LFNIndex() override {} /// @see CollectionIndex - int init(); + int init() override; /// @see CollectionIndex - int cleanup() = 0; + int cleanup() override = 0; /// @see CollectionIndex int created( const ghobject_t &oid, const char *path - ); + ) override; /// @see CollectionIndex int unlink( const ghobject_t &oid - ); + ) override; /// @see CollectionIndex int lookup( const ghobject_t &oid, IndexedPath *path, int *hardlink - ); + ) override; /// @see CollectionIndex; int pre_hash_collection( uint32_t pg_num, uint64_t expected_num_objs - ); + ) override; /// @see CollectionIndex int collection_list_partial( @@ -192,7 +192,7 @@ public: int max_count, vector *ls, ghobject_t *next - ); + ) override; virtual int _split( uint32_t match, //< [in] value to match @@ -205,7 +205,7 @@ public: uint32_t match, uint32_t bits, CollectionIndex* dest - ) { + ) override { WRAP_RETRY( r = _split(match, bits, dest); goto out; diff --git a/src/os/filestore/WBThrottle.h b/src/os/filestore/WBThrottle.h index 9a3d0a788bfe..5c71dacafe11 100644 --- a/src/os/filestore/WBThrottle.h +++ b/src/os/filestore/WBThrottle.h @@ -147,7 +147,7 @@ private: public: explicit WBThrottle(CephContext *cct); - ~WBThrottle(); + ~WBThrottle() override; void start(); void stop(); @@ -177,12 +177,12 @@ public: void throttle(); /// md_config_obs_t - const char** get_tracked_conf_keys() const; + const char** get_tracked_conf_keys() const override; void handle_conf_change(const md_config_t *conf, - const std::set &changed); + const std::set &changed) override; /// Thread - void *entry(); + void *entry() override; }; #endif diff --git a/src/os/filestore/XfsFileStoreBackend.h b/src/os/filestore/XfsFileStoreBackend.h index 29f412f934a7..e8b81f9a1286 100644 --- a/src/os/filestore/XfsFileStoreBackend.h +++ b/src/os/filestore/XfsFileStoreBackend.h @@ -25,12 +25,12 @@ private: int set_extsize(int fd, unsigned int val); public: explicit XfsFileStoreBackend(FileStore *fs); - ~XfsFileStoreBackend() {} - const char *get_name() { + ~XfsFileStoreBackend() override {} + const char *get_name() override { return "xfs"; } - int detect_features(); - int set_alloc_hint(int fd, uint64_t hint); + int detect_features() override; + int set_alloc_hint(int fd, uint64_t hint) override; }; #endif /* CEPH_XFSFILESTOREBACKEND_H */ diff --git a/src/os/fs/XFS.h b/src/os/fs/XFS.h index 7262f76961cc..f0ea717e3c01 100644 --- a/src/os/fs/XFS.h +++ b/src/os/fs/XFS.h @@ -22,10 +22,10 @@ # endif class XFS : public FS { - const char *get_name() { + const char *get_name() override { return "xfs"; } - int set_alloc_hint(int fd, uint64_t hint); + int set_alloc_hint(int fd, uint64_t hint) override; }; #endif diff --git a/src/os/kstore/KStore.h b/src/os/kstore/KStore.h index cf1eb0b939f9..c80deb546797 100644 --- a/src/os/kstore/KStore.h +++ b/src/os/kstore/KStore.h @@ -168,14 +168,14 @@ public: string head, tail; public: OmapIteratorImpl(CollectionRef c, OnodeRef o, KeyValueDB::Iterator it); - int seek_to_first(); - int upper_bound(const string &after); - int lower_bound(const string &to); - bool valid(); - int next(bool validate=true); - string key(); - bufferlist value(); - int status() { + int seek_to_first() override; + int upper_bound(const string &after) override; + int lower_bound(const string &to) override; + bool valid() override; + int next(bool validate=true) override; + string key() override; + bufferlist value() override; + int status() override { return 0; } }; @@ -272,7 +272,7 @@ public: : Sequencer_impl(cct), parent(NULL) { } - ~OpSequencer() { + ~OpSequencer() override { assert(q.empty()); } @@ -281,13 +281,13 @@ public: q.push_back(*txc); } - void flush() { + void flush() override { std::unique_lock l(qlock); while (!q.empty()) qcond.wait(l); } - bool flush_commit(Context *c) { + bool flush_commit(Context *c) override { std::lock_guard l(qlock); if (q.empty()) { return true; @@ -305,7 +305,7 @@ public: struct KVSyncThread : public Thread { KStore *store; explicit KVSyncThread(KStore *s) : store(s) {} - void *entry() { + void *entry() override { store->_kv_sync_thread(); return NULL; } @@ -403,22 +403,22 @@ private: public: KStore(CephContext *cct, const string& path); - ~KStore(); + ~KStore() override; - string get_type() { + string get_type() override { return "kstore"; } - bool needs_journal() { return false; }; - bool wants_journal() { return false; }; - bool allows_journal() { return false; }; + bool needs_journal() override { return false; }; + bool wants_journal() override { return false; }; + bool allows_journal() override { return false; }; static int get_block_device_fsid(const string& path, uuid_d *fsid); - bool test_mount_in_use(); + bool test_mount_in_use() override; - int mount(); - int umount(); + int mount() override; + int umount() override; void _sync(); int fsck(bool deep) override; @@ -427,12 +427,12 @@ public: int validate_hobject_key(const hobject_t &obj) const override { return 0; } - unsigned get_max_attr_name_length() { + unsigned get_max_attr_name_length() override { return 256; // arbitrary; there is no real limit internally } - int mkfs(); - int mkjournal() { + int mkfs() override; + int mkjournal() override { return 0; } void dump_perf_counters(Formatter *f) override { @@ -444,16 +444,16 @@ public: int statfs(struct store_statfs_t *buf) override; using ObjectStore::exists; - bool exists(const coll_t& cid, const ghobject_t& oid); + bool exists(const coll_t& cid, const ghobject_t& oid) override; using ObjectStore::stat; int stat( const coll_t& cid, const ghobject_t& oid, struct stat *st, - bool allow_eio = false); // struct stat? + bool allow_eio = false) override; // struct stat? int set_collection_opts( const coll_t& cid, - const pool_opts_t& opts); + const pool_opts_t& opts) override; using ObjectStore::read; int read( const coll_t& cid, @@ -462,7 +462,7 @@ public: size_t len, bufferlist& bl, uint32_t op_flags = 0, - bool allow_eio = false); + bool allow_eio = false) override; int _do_read( OnodeRef o, uint64_t offset, @@ -471,15 +471,15 @@ public: uint32_t op_flags = 0); using ObjectStore::fiemap; - int fiemap(const coll_t& cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl); + int fiemap(const coll_t& cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl) override; using ObjectStore::getattr; - int getattr(const coll_t& cid, const ghobject_t& oid, const char *name, bufferptr& value); + int getattr(const coll_t& cid, const ghobject_t& oid, const char *name, bufferptr& value) override; using ObjectStore::getattrs; - int getattrs(const coll_t& cid, const ghobject_t& oid, map& aset); + int getattrs(const coll_t& cid, const ghobject_t& oid, map& aset) override; - int list_collections(vector& ls); - bool collection_exists(const coll_t& c); - int collection_empty(const coll_t& c, bool *empty); + int list_collections(vector& ls) override; + bool collection_exists(const coll_t& c) override; + int collection_empty(const coll_t& c, bool *empty) override; int collection_list( const coll_t& cid, const ghobject_t& start, const ghobject_t& end, @@ -496,7 +496,7 @@ public: const ghobject_t &oid, ///< [in] Object containing omap bufferlist *header, ///< [out] omap header map *out /// < [out] Key to value map - ); + ) override; using ObjectStore::omap_get_header; /// Get omap header @@ -505,7 +505,7 @@ public: const ghobject_t &oid, ///< [in] Object containing omap bufferlist *header, ///< [out] omap header bool allow_eio = false ///< [in] don't assert on eio - ); + ) override; using ObjectStore::omap_get_keys; /// Get keys defined on oid @@ -513,7 +513,7 @@ public: const coll_t& cid, ///< [in] Collection containing oid const ghobject_t &oid, ///< [in] Object containing omap set *keys ///< [out] Keys defined on oid - ); + ) override; using ObjectStore::omap_get_values; /// Get key values @@ -522,7 +522,7 @@ public: const ghobject_t &oid, ///< [in] Object containing omap const set &keys, ///< [in] Keys to get map *out ///< [out] Returned keys and values - ); + ) override; using ObjectStore::omap_check_keys; /// Filters keys into out which are defined on oid @@ -531,18 +531,18 @@ public: const ghobject_t &oid, ///< [in] Object containing omap const set &keys, ///< [in] Keys to check set *out ///< [out] Subset of keys defined on oid - ); + ) override; using ObjectStore::get_omap_iterator; ObjectMap::ObjectMapIterator get_omap_iterator( const coll_t& cid, ///< [in] collection const ghobject_t &oid ///< [in] object - ); + ) override; - void set_fsid(uuid_d u) { + void set_fsid(uuid_d u) override { fsid = u; } - uuid_d get_fsid() { + uuid_d get_fsid() override { return fsid; } @@ -550,10 +550,10 @@ public: return num_objects * 300; //assuming per-object overhead is 300 bytes } - objectstore_perf_stat_t get_cur_stats() { + objectstore_perf_stat_t get_cur_stats() override { return objectstore_perf_stat_t(); } - const PerfCounters* get_perf_counters() const { + const PerfCounters* get_perf_counters() const override { return logger; } @@ -562,7 +562,7 @@ public: Sequencer *osr, vector& tls, TrackedOpRef op = TrackedOpRef(), - ThreadPool::TPHandle *handle = NULL); + ThreadPool::TPHandle *handle = NULL) override; private: // -------------------------------------------------------- diff --git a/src/os/memstore/MemStore.h b/src/os/memstore/MemStore.h index 534c1b9ea7b6..ca1c5004f6ee 100644 --- a/src/os/memstore/MemStore.h +++ b/src/os/memstore/MemStore.h @@ -242,7 +242,7 @@ public: coll_lock("MemStore::coll_lock"), finisher(cct), used_bytes(0) {} - ~MemStore() { } + ~MemStore() override { } string get_type() override { return "memstore"; @@ -290,7 +290,7 @@ public: struct stat *st, bool allow_eio = false) override; int set_collection_opts( const coll_t& cid, - const pool_opts_t& opts); + const pool_opts_t& opts) override; int read( const coll_t& cid, const ghobject_t& oid, @@ -388,7 +388,7 @@ public: objectstore_perf_stat_t get_cur_stats() override; - const PerfCounters* get_perf_counters() const { + const PerfCounters* get_perf_counters() const override { return nullptr; } diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index c4b40902cc7c..27bbe24798f3 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -457,7 +457,7 @@ struct SendPushReplies : public Context { } replies.clear(); } - ~SendPushReplies() { + ~SendPushReplies() override { for (map::iterator i = replies.begin(); i != replies.end(); ++i) { diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index bf568816d72f..96913644fe5e 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -34,12 +34,12 @@ struct ECSubReadReply; struct RecoveryMessages; class ECBackend : public PGBackend { public: - RecoveryHandle *open_recovery_op(); + RecoveryHandle *open_recovery_op() override; void run_recovery_op( RecoveryHandle *h, int priority - ); + ) override; void recover_object( const hobject_t &hoid, @@ -47,14 +47,14 @@ public: ObjectContextRef head, ObjectContextRef obc, RecoveryHandle *h - ); + ) override; bool handle_message( OpRequestRef op - ); + ) override; bool can_handle_while_inactive( OpRequestRef op - ); + ) override; friend struct SubWriteApplied; friend struct SubWriteCommitted; void sub_write_applied( @@ -83,14 +83,14 @@ public: ); /// @see ReadOp below - void check_recovery_sources(const OSDMapRef& osdmap); + void check_recovery_sources(const OSDMapRef& osdmap) override; - void on_change(); - void clear_recovery_state(); + void on_change() override; + void clear_recovery_state() override; - void on_flushed(); + void on_flushed() override; - void dump_recovery_info(Formatter *f) const; + void dump_recovery_info(Formatter *f) const override; void call_write_ordered(std::function &&cb) override; @@ -109,14 +109,14 @@ public: ceph_tid_t tid, osd_reqid_t reqid, OpRequestRef op - ); + ) override; int objects_read_sync( const hobject_t &hoid, uint64_t off, uint64_t len, uint32_t op_flags, - bufferlist *bl); + bufferlist *bl) override; /** * Async read mechanism @@ -173,7 +173,7 @@ public: const list, pair > > &to_read, Context *on_complete, - bool fast_read = false); + bool fast_read = false) override; template void objects_read_async_no_cache( @@ -574,7 +574,7 @@ public: want.insert(i); } } - bool operator()(const set &_have) const { + bool operator()(const set &_have) const override { set have; for (set::const_iterator i = _have.begin(); i != _have.end(); @@ -585,7 +585,7 @@ public: return ec_impl->minimum_to_decode(want, have, &min) == 0; } }; - IsPGRecoverablePredicate *get_is_recoverable_predicate() { + IsPGRecoverablePredicate *get_is_recoverable_predicate() override { return new ECRecPred(ec_impl); } @@ -601,11 +601,11 @@ public: ECReadPred( pg_shard_t whoami, ErasureCodeInterfaceRef ec_impl) : whoami(whoami), rec_pred(ec_impl) {} - bool operator()(const set &_have) const { + bool operator()(const set &_have) const override { return _have.count(whoami) && rec_pred(_have); } }; - IsPGReadablePredicate *get_is_readable_predicate() { + IsPGReadablePredicate *get_is_readable_predicate() override { return new ECReadPred(get_parent()->whoami_shard(), ec_impl); } @@ -642,22 +642,22 @@ public: int objects_get_attrs( const hobject_t &hoid, - map *out); + map *out) override; void rollback_append( const hobject_t &hoid, uint64_t old_size, - ObjectStore::Transaction *t); + ObjectStore::Transaction *t) override; - bool scrub_supported() { return true; } - bool auto_repair_supported() const { return true; } + bool scrub_supported() override { return true; } + bool auto_repair_supported() const override { return true; } void be_deep_scrub( const hobject_t &obj, uint32_t seed, ScrubMap::object &o, - ThreadPool::TPHandle &handle); - uint64_t be_get_ondisk_size(uint64_t logical_size) { + ThreadPool::TPHandle &handle) override; + uint64_t be_get_ondisk_size(uint64_t logical_size) override { return sinfo.logical_to_next_chunk_offset(logical_size); } void _failed_push(const hobject_t &hoid, diff --git a/src/osd/HitSet.h b/src/osd/HitSet.h index 13f6c31b6aa9..0f8bc9a60b2e 100644 --- a/src/osd/HitSet.h +++ b/src/osd/HitSet.h @@ -347,7 +347,7 @@ public: : fpp_micro(o.fpp_micro), target_size(o.target_size), seed(o.seed) {} - ~Params() {} + ~Params() override {} double get_fpp() const { return (double)fpp_micro / 1000000.0; diff --git a/src/osd/OSD.h b/src/osd/OSD.h index ebcc87ffd4fa..fe05616fc846 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -767,7 +767,7 @@ private: struct AgentThread : public Thread { OSDService *osd; explicit AgentThread(OSDService *o) : osd(o) {} - void *entry() { + void *entry() override { osd->agent_entry(); return NULL; } @@ -1263,9 +1263,9 @@ class OSD : public Dispatcher, SafeTimer tick_timer_without_osd_lock; public: // config observer bits - virtual const char** get_tracked_conf_keys() const; - virtual void handle_conf_change(const struct md_config_t *conf, - const std::set &changed); + const char** get_tracked_conf_keys() const override; + void handle_conf_change(const struct md_config_t *conf, + const std::set &changed) override; void update_log_config(); void check_config(); @@ -1594,7 +1594,7 @@ private: struct T_Heartbeat : public Thread { OSD *osd; explicit T_Heartbeat(OSD *o) : osd(o) {} - void *entry() { + void *entry() override { osd->heartbeat_entry(); return 0; } @@ -1607,7 +1607,7 @@ public: OSD *osd; explicit HeartbeatDispatcher(OSD *o) : Dispatcher(o->cct), osd(o) {} - bool ms_can_fast_dispatch_any() const { return true; } + bool ms_can_fast_dispatch_any() const override { return true; } bool ms_can_fast_dispatch(const Message *m) const override { switch (m->get_type()) { case CEPH_MSG_PING: @@ -1617,22 +1617,22 @@ public: return false; } } - void ms_fast_dispatch(Message *m) { + void ms_fast_dispatch(Message *m) override { osd->heartbeat_dispatch(m); } - bool ms_dispatch(Message *m) { + bool ms_dispatch(Message *m) override { return osd->heartbeat_dispatch(m); } - bool ms_handle_reset(Connection *con) { + bool ms_handle_reset(Connection *con) override { return osd->heartbeat_reset(con); } - void ms_handle_remote_reset(Connection *con) {} - bool ms_handle_refused(Connection *con) { + void ms_handle_remote_reset(Connection *con) override {} + bool ms_handle_refused(Connection *con) override { return osd->ms_handle_refused(con); } bool ms_verify_authorizer(Connection *con, int peer_type, int protocol, bufferlist& authorizer_data, bufferlist& authorizer_reply, - bool& isvalid, CryptoKey& session_key) { + bool& isvalid, CryptoKey& session_key) override { isvalid = true; return true; } @@ -1778,7 +1778,7 @@ private: shard_list.push_back(one_shard); } } - ~ShardedOpWQ() { + ~ShardedOpWQ() override { while (!shard_list.empty()) { delete shard_list.back(); shard_list.pop_back(); @@ -1798,15 +1798,15 @@ private: void clear_pg_slots(); /// try to do some work - void _process(uint32_t thread_index, heartbeat_handle_d *hb); + void _process(uint32_t thread_index, heartbeat_handle_d *hb) override; /// enqueue a new item - void _enqueue(pair item); + void _enqueue(pair item) override; /// requeue an old item (at the front of the line) - void _enqueue_front(pair item); + void _enqueue_front(pair item) override; - void return_waiting_threads() { + void return_waiting_threads() override { for(uint32_t i = 0; i < num_shards; i++) { ShardData* sdata = shard_list[i]; assert (NULL != sdata); @@ -2312,7 +2312,7 @@ protected: } remove_wq; private: - bool ms_can_fast_dispatch_any() const { return true; } + bool ms_can_fast_dispatch_any() const override { return true; } bool ms_can_fast_dispatch(const Message *m) const override { switch (m->get_type()) { case CEPH_MSG_OSD_OP: @@ -2338,19 +2338,19 @@ protected: return false; } } - void ms_fast_dispatch(Message *m); - void ms_fast_preprocess(Message *m); - bool ms_dispatch(Message *m); - bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new); + void ms_fast_dispatch(Message *m) override; + void ms_fast_preprocess(Message *m) override; + bool ms_dispatch(Message *m) override; + bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override; bool ms_verify_authorizer(Connection *con, int peer_type, int protocol, bufferlist& authorizer, bufferlist& authorizer_reply, - bool& isvalid, CryptoKey& session_key); - void ms_handle_connect(Connection *con); - void ms_handle_fast_connect(Connection *con); - void ms_handle_fast_accept(Connection *con); - bool ms_handle_reset(Connection *con); - void ms_handle_remote_reset(Connection *con) {} - bool ms_handle_refused(Connection *con); + bool& isvalid, CryptoKey& session_key) override; + void ms_handle_connect(Connection *con) override; + void ms_handle_fast_connect(Connection *con) override; + void ms_handle_fast_accept(Connection *con) override; + bool ms_handle_reset(Connection *con) override; + void ms_handle_remote_reset(Connection *con) override {} + bool ms_handle_refused(Connection *con) override; io_queue get_io_queue() const { if (cct->_conf->osd_op_queue == "debug_random") { @@ -2388,7 +2388,7 @@ protected: Messenger *hb_back_server, Messenger *osdc_messenger, MonClient *mc, const std::string &dev, const std::string &jdev); - ~OSD(); + ~OSD() override; // static bits static int mkfs(CephContext *cct, ObjectStore *store, diff --git a/src/osd/OSDMapMapping.h b/src/osd/OSDMapMapping.h index 51a445db5acb..c325693785ea 100644 --- a/src/osd/OSDMapMapping.h +++ b/src/osd/OSDMapMapping.h @@ -269,10 +269,10 @@ private: : Job(osdmap), mapping(m) { mapping->_start(*osdmap); } - void process(int64_t pool, unsigned ps_begin, unsigned ps_end) { + void process(int64_t pool, unsigned ps_begin, unsigned ps_end) override { mapping->_update_range(*osdmap, pool, ps_begin, ps_end); } - void complete() { + void complete() override { mapping->_finish(*osdmap); } }; diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index 9bd41830888f..a32e03b9e937 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -76,7 +76,7 @@ struct OpRequest : public TrackedOp { return classes_; } - void _dump(Formatter *f) const; + void _dump(Formatter *f) const override; bool has_feature(uint64_t f) const { return request->get_connection()->has_feature(f); @@ -100,11 +100,11 @@ private: OpRequest(Message *req, OpTracker *tracker); protected: - void _dump_op_descriptor_unlocked(ostream& stream) const; - void _unregistered(); + void _dump_op_descriptor_unlocked(ostream& stream) const override; + void _unregistered() override; public: - ~OpRequest() { + ~OpRequest() override { request->put(); } @@ -123,7 +123,7 @@ public: } } - const char *state_string() const { + const char *state_string() const override { switch(latest_flag_point) { case flag_queued_for_pg: return "queued for pg"; case flag_reached_pg: return "reached pg"; diff --git a/src/osd/PG.h b/src/osd/PG.h index 16ba57be1f78..6c90e8d2c180 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -205,9 +205,9 @@ protected: virtual PGBackend *get_pgbackend() = 0; public: - std::string gen_prefix() const; - CephContext *get_cct() const { return cct; } - unsigned get_subsys() const { return ceph_subsys_osd; } + std::string gen_prefix() const override; + CephContext *get_cct() const override { return cct; } + unsigned get_subsys() const override { return ceph_subsys_osd; } /*** PG ****/ void update_snap_mapper_bits(uint32_t bits) { @@ -527,7 +527,7 @@ public: eversion_t v; C_UpdateLastRollbackInfoTrimmedToApplied(PG *pg, epoch_t e, eversion_t v) : pg(pg), e(e), v(v) {} - void finish(int) { + void finish(int) override { pg->lock(); if (!pg->pg_has_reset_since(e)) { pg->last_rollback_info_trimmed_to_applied = v; @@ -981,20 +981,20 @@ public: PGLogEntryHandler(PG *pg, ObjectStore::Transaction *t) : pg(pg), t(t) {} // LogEntryHandler - void remove(const hobject_t &hoid) { + void remove(const hobject_t &hoid) override { pg->get_pgbackend()->remove(hoid, t); } - void try_stash(const hobject_t &hoid, version_t v) { + void try_stash(const hobject_t &hoid, version_t v) override { pg->get_pgbackend()->try_stash(hoid, v, t); } - void rollback(const pg_log_entry_t &entry) { + void rollback(const pg_log_entry_t &entry) override { assert(entry.can_rollback()); pg->get_pgbackend()->rollback(entry, t); } - void rollforward(const pg_log_entry_t &entry) { + void rollforward(const pg_log_entry_t &entry) override { pg->get_pgbackend()->rollforward(entry, t); } - void trim(const pg_log_entry_t &entry) { + void trim(const pg_log_entry_t &entry) override { pg->get_pgbackend()->trim(entry, t); } }; @@ -1349,7 +1349,7 @@ public: EVT evt; QueuePeeringEvt(PG *pg, epoch_t epoch, EVT evt) : pg(pg), epoch(epoch), evt(evt) {} - void finish(int r) { + void finish(int r) override { pg->lock(); pg->queue_peering_event(PG::CephPeeringEvtRef( new PG::CephPeeringEvt( @@ -2115,7 +2115,7 @@ public: public: PG(OSDService *o, OSDMapRef curmap, const PGPool &pool, spg_t p); - virtual ~PG(); + ~PG() override; private: // Prevent copying diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index d67faab20e95..5096e203179c 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -33,14 +33,14 @@ class CephContext; struct PGLog : DoutPrefixProvider { DoutPrefixProvider *prefix_provider; - string gen_prefix() const { + string gen_prefix() const override { return prefix_provider ? prefix_provider->gen_prefix() : ""; } - unsigned get_subsys() const { + unsigned get_subsys() const override { return prefix_provider ? prefix_provider->get_subsys() : (unsigned)ceph_subsys_osd; } - CephContext *get_cct() const { + CephContext *get_cct() const override { return cct; } @@ -66,7 +66,7 @@ struct PGLog : DoutPrefixProvider { explicit read_log_and_missing_error(const char *what) { snprintf(buf, sizeof(buf), "read_log_and_missing_error: %s", what); } - const char *what() const throw () { + const char *what() const throw () override { return buf; } private: diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 3f3f5b088f7c..becd818b8996 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -122,7 +122,7 @@ protected: public: /// Provide the final size of the copied object to the CopyCallback - ~CopyCallback() {} + ~CopyCallback() override {} }; template @@ -209,7 +209,7 @@ struct OnReadComplete : public Context { opcontext->async_read_result = r; opcontext->finish_read(pg); } - ~OnReadComplete() {} + ~OnReadComplete() override {} }; class PrimaryLogPG::C_OSD_AppliedRecoveredObject : public Context { @@ -280,7 +280,7 @@ public: : results(NULL), retval(0), ctx(ctx_) {} - ~CopyFromCallback() {} + ~CopyFromCallback() override {} void finish(PrimaryLogPG::CopyCallbackResults results_) override { results = results_.get<1>(); @@ -689,7 +689,7 @@ public: return 0; } - ~PGLSPlainFilter() {} + ~PGLSPlainFilter() override {} bool filter(const hobject_t &obj, bufferlist& xattr_data, bufferlist& outdata) override; }; @@ -712,7 +712,7 @@ public: return 0; } - ~PGLSParentFilter() {} + ~PGLSParentFilter() override {} bool filter(const hobject_t &obj, bufferlist& xattr_data, bufferlist& outdata) override; }; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 802daef3e93f..d5f613e56776 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -351,7 +351,7 @@ public: return manager.try_get_read_lock(hoid, obc); } - void release_locks(ObcLockManager &manager) { + void release_locks(ObcLockManager &manager) override { release_object_locks(manager); } @@ -1287,17 +1287,17 @@ protected: friend struct C_Flush; // -- scrub -- - virtual bool _range_available_for_scrub( + bool _range_available_for_scrub( const hobject_t &begin, const hobject_t &end) override; - virtual void scrub_snapshot_metadata( + void scrub_snapshot_metadata( ScrubMap &map, const std::map> &missing_digest) override; - virtual void _scrub_clear_state() override; - virtual void _scrub_finish() override; + void _scrub_clear_state() override; + void _scrub_finish() override; object_stat_collection_t scrub_cstat; - virtual void _split_into(pg_t child_pgid, PG *child, - unsigned split_bits) override; + void _split_into(pg_t child_pgid, PG *child, + unsigned split_bits) override; void apply_and_flush_repops(bool requeue); void calc_trim_to() override; @@ -1334,7 +1334,7 @@ protected: public: PrimaryLogPG(OSDService *o, OSDMapRef curmap, const PGPool &_pool, spg_t p); - ~PrimaryLogPG() {} + ~PrimaryLogPG() override {} int do_command( cmdmap_t cmdmap, diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 1ae2d0d0de9c..8d942b0cf76e 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -324,7 +324,7 @@ struct AsyncReadCallback : public GenContext { c->complete(r); c = NULL; } - ~AsyncReadCallback() { + ~AsyncReadCallback() override { delete c; } }; diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h index c4f40ae81c1a..f2ceda687c65 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -38,14 +38,14 @@ public: RPGHandle *_open_recovery_op() { return new RPGHandle(); } - PGBackend::RecoveryHandle *open_recovery_op() { + PGBackend::RecoveryHandle *open_recovery_op() override { return _open_recovery_op(); } /// @see PGBackend::run_recovery_op void run_recovery_op( PGBackend::RecoveryHandle *h, - int priority); + int priority) override; /// @see PGBackend::recover_object void recover_object( @@ -54,29 +54,29 @@ public: ObjectContextRef head, ObjectContextRef obc, RecoveryHandle *h - ); + ) override; - void check_recovery_sources(const OSDMapRef& osdmap); + void check_recovery_sources(const OSDMapRef& osdmap) override; /// @see PGBackend::delay_message_until_active - bool can_handle_while_inactive(OpRequestRef op); + bool can_handle_while_inactive(OpRequestRef op) override; /// @see PGBackend::handle_message bool handle_message( OpRequestRef op - ); + ) override; - void on_change(); - void clear_recovery_state(); - void on_flushed(); + void on_change() override; + void clear_recovery_state() override; + void on_flushed() override; class RPCRecPred : public IsPGRecoverablePredicate { public: - bool operator()(const set &have) const { + bool operator()(const set &have) const override { return !have.empty(); } }; - IsPGRecoverablePredicate *get_is_recoverable_predicate() { + IsPGRecoverablePredicate *get_is_recoverable_predicate() override { return new RPCRecPred; } @@ -84,15 +84,15 @@ public: pg_shard_t whoami; public: explicit RPCReadPred(pg_shard_t whoami) : whoami(whoami) {} - bool operator()(const set &have) const { + bool operator()(const set &have) const override { return have.count(whoami); } }; - IsPGReadablePredicate *get_is_readable_predicate() { + IsPGReadablePredicate *get_is_readable_predicate() override { return new RPCReadPred(get_parent()->whoami_shard()); } - virtual void dump_recovery_info(Formatter *f) const { + void dump_recovery_info(Formatter *f) const override { { f->open_array_section("pull_from_peer"); for (map >::const_iterator i = pull_from_peer.begin(); @@ -151,14 +151,14 @@ public: uint64_t off, uint64_t len, uint32_t op_flags, - bufferlist *bl); + bufferlist *bl) override; void objects_read_async( const hobject_t &hoid, const list, pair > > &to_read, Context *on_complete, - bool fast_read = false); + bool fast_read = false) override; private: // push @@ -380,7 +380,7 @@ public: ceph_tid_t tid, osd_reqid_t reqid, OpRequestRef op - ); + ) override; private: Message * generate_subop( @@ -434,16 +434,16 @@ private: void sub_op_modify_applied(RepModifyRef rm); void sub_op_modify_commit(RepModifyRef rm); - bool scrub_supported() { return true; } - bool auto_repair_supported() const { return false; } + bool scrub_supported() override { return true; } + bool auto_repair_supported() const override { return false; } void be_deep_scrub( const hobject_t &obj, uint32_t seed, ScrubMap::object &o, - ThreadPool::TPHandle &handle); - uint64_t be_get_ondisk_size(uint64_t logical_size) { return logical_size; } + ThreadPool::TPHandle &handle) override; + uint64_t be_get_ondisk_size(uint64_t logical_size) override { return logical_size; } }; #endif diff --git a/src/osd/SnapMapper.h b/src/osd/SnapMapper.h index ef59cdedee91..241f581b6d7f 100644 --- a/src/osd/SnapMapper.h +++ b/src/osd/SnapMapper.h @@ -45,15 +45,15 @@ public: : cid(cid), hoid(hoid), t(t) {} public: void set_keys( - const std::map &to_set) { + const std::map &to_set) override { t->omap_setkeys(cid, hoid, to_set); } void remove_keys( - const std::set &to_remove) { + const std::set &to_remove) override { t->omap_rmkeys(cid, hoid, to_remove); } void add_callback( - Context *c) { + Context *c) override { t->register_on_applied(c); } }; @@ -67,10 +67,10 @@ public: os(os), cid(cid), hoid(hoid) {} int get_keys( const std::set &keys, - std::map *out); + std::map *out) override; int get_next( const std::string &key, - pair *next); + pair *next) override; }; /** diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index 8386caf36261..a0305b65213e 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -424,7 +424,7 @@ class ObjectCacher { ObjectCacher *oc; public: explicit FlusherThread(ObjectCacher *o) : oc(o) {} - void *entry() { + void *entry() override { oc->flusher_entry(); return 0; } diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 595549d3e8e5..d45e4c45fb0a 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -179,7 +179,7 @@ public: second = NULL; } - ~C_TwoContexts() { + ~C_TwoContexts() override { delete first; delete second; } diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index b00ed2218187..534da8da1f88 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -232,7 +232,7 @@ struct ObjectOperation { C_ObjectOperation_stat(uint64_t *ps, ceph::real_time *pm, time_t *pt, struct timespec *_pts, int *prval) : psize(ps), pmtime(pm), ptime(pt), pts(_pts), prval(prval) {} - void finish(int r) { + void finish(int r) override { if (r >= 0) { bufferlist::iterator p = bl.begin(); try { @@ -302,7 +302,7 @@ struct ObjectOperation { std::map *extents, int *prval) : data_bl(data_bl), extents(extents), prval(prval) {} - void finish(int r) { + void finish(int r) override { bufferlist::iterator iter = bl.begin(); if (r >= 0) { try { @@ -388,7 +388,7 @@ struct ObjectOperation { *ptruncated = false; } } - void finish(int r) { + void finish(int r) override { if (r >= 0) { bufferlist::iterator p = bl.begin(); try { @@ -430,7 +430,7 @@ struct ObjectOperation { *ptruncated = false; } } - void finish(int r) { + void finish(int r) override { if (r >= 0) { bufferlist::iterator p = bl.begin(); try { @@ -465,7 +465,7 @@ struct ObjectOperation { int *prval; C_ObjectOperation_decodewatchers(list *pw, int *pr) : pwatchers(pw), prval(pr) {} - void finish(int r) { + void finish(int r) override { if (r >= 0) { bufferlist::iterator p = bl.begin(); try { @@ -498,7 +498,7 @@ struct ObjectOperation { int *prval; C_ObjectOperation_decodesnaps(librados::snap_set_t *ps, int *pr) : psnaps(ps), prval(pr) {} - void finish(int r) { + void finish(int r) override { if (r >= 0) { bufferlist::iterator p = bl.begin(); try { @@ -709,7 +709,7 @@ struct ObjectOperation { out_truncate_seq(otseq), out_truncate_size(otsize), prval(r) {} - void finish(int r) { + void finish(int r) override { // reqids are copied on ENOENT if (r < 0 && r != -ENOENT) return; @@ -802,7 +802,7 @@ struct ObjectOperation { int *prval; C_ObjectOperation_isdirty(bool *p, int *r) : pisdirty(p), prval(r) {} - void finish(int r) { + void finish(int r) override { if (r < 0) return; try { @@ -838,7 +838,7 @@ struct ObjectOperation { ceph::real_time> > *ut, int *r) : ptls(t), putls(ut), prval(r) {} - void finish(int r) { + void finish(int r) override { if (r < 0) return; try { @@ -1119,9 +1119,9 @@ struct ObjectOperation { class Objecter : public md_config_obs_t, public Dispatcher { public: // config observer bits - virtual const char** get_tracked_conf_keys() const; - virtual void handle_conf_change(const struct md_config_t *conf, - const std::set &changed); + const char** get_tracked_conf_keys() const override; + void handle_conf_change(const struct md_config_t *conf, + const std::set &changed) override; public: Messenger *messenger; @@ -1344,7 +1344,7 @@ public: } private: - ~Op() { + ~Op() override { while (!out_handler.empty()) { delete out_handler.back(); out_handler.pop_back(); @@ -1358,7 +1358,7 @@ public: version_t latest; C_Op_Map_Latest(Objecter *o, ceph_tid_t t) : objecter(o), tid(t), latest(0) {} - void finish(int r); + void finish(int r) override; }; struct C_Command_Map_Latest : public Context { @@ -1367,7 +1367,7 @@ public: version_t latest; C_Command_Map_Latest(Objecter *o, ceph_tid_t t) : objecter(o), tid(t), latest(0) {} - void finish(int r); + void finish(int r) override; }; struct C_Stat : public Context { @@ -1377,7 +1377,7 @@ public: Context *fin; C_Stat(uint64_t *ps, ceph::real_time *pm, Context *c) : psize(ps), pmtime(pm), fin(c) {} - void finish(int r) { + void finish(int r) override { if (r >= 0) { bufferlist::iterator p = bl.begin(); uint64_t s; @@ -1399,7 +1399,7 @@ public: Context *fin; C_GetAttrs(map& set, Context *c) : attrset(set), fin(c) {} - void finish(int r) { + void finish(int r) override { if (r >= 0) { bufferlist::iterator p = bl.begin(); ::decode(attrset, p); @@ -1454,7 +1454,7 @@ public: epoch_t epoch; C_NList(NListContext *lc, Context * finish, Objecter *ob) : list_context(lc), final_finish(finish), objecter(ob), epoch(0) {} - void finish(int r) { + void finish(int r) override { if (r >= 0) { objecter->_nlist_reply(list_context, r, final_finish, epoch); } else { @@ -1656,7 +1656,7 @@ public: } private: - ~LingerOp() { + ~LingerOp() override { delete watch_context; } }; @@ -1668,10 +1668,10 @@ public: C_Linger_Commit(Objecter *o, LingerOp *l) : objecter(o), info(l) { info->get(); } - ~C_Linger_Commit() { + ~C_Linger_Commit() override { info->put(); } - void finish(int r) { + void finish(int r) override { objecter->_linger_commit(info, r, outbl); } }; @@ -1682,10 +1682,10 @@ public: C_Linger_Reconnect(Objecter *o, LingerOp *l) : objecter(o), info(l) { info->get(); } - ~C_Linger_Reconnect() { + ~C_Linger_Reconnect() override { info->put(); } - void finish(int r) { + void finish(int r) override { objecter->_linger_reconnect(info, r); } }; @@ -1699,10 +1699,10 @@ public: : objecter(o), info(l), register_gen(info->register_gen) { info->get(); } - ~C_Linger_Ping() { + ~C_Linger_Ping() override { info->put(); } - void finish(int r) { + void finish(int r) override { objecter->_linger_ping(info, r, sent, register_gen); } }; @@ -1713,7 +1713,7 @@ public: version_t latest; C_Linger_Map_Latest(Objecter *o, uint64_t id) : objecter(o), linger_id(id), latest(0) {} - void finish(int r); + void finish(int r) override; }; // -- osd sessions -- @@ -1753,7 +1753,7 @@ public: num_locks(cct->_conf->objecter_completion_locks_per_session), completion_locks(new std::mutex[num_locks]) {} - ~OSDSession(); + ~OSDSession() override; bool is_homeless() { return (osd == -1); } @@ -1933,7 +1933,7 @@ private: epoch_barrier(0), retry_writes_after_first_reply(cct->_conf->objecter_retry_writes_after_first_reply) { } - ~Objecter(); + ~Objecter() override; void init(); void start(const OSDMap *o = nullptr); @@ -2009,8 +2009,8 @@ private: // messages public: - bool ms_dispatch(Message *m); - bool ms_can_fast_dispatch_any() const { + bool ms_dispatch(Message *m) override; + bool ms_can_fast_dispatch_any() const override { return true; } bool ms_can_fast_dispatch(const Message *m) const override { @@ -2022,7 +2022,7 @@ private: return false; } } - void ms_fast_dispatch(Message *m) { + void ms_fast_dispatch(Message *m) override { ms_dispatch(m); } @@ -2837,7 +2837,7 @@ public: extents.swap(e); resultbl.swap(r); } - void finish(int r) { + void finish(int r) override { objecter->_sg_read_finish(extents, resultbl, bl, onfinish); } }; @@ -2907,13 +2907,13 @@ public: op_flags); } - void ms_handle_connect(Connection *con); - bool ms_handle_reset(Connection *con); - void ms_handle_remote_reset(Connection *con); - bool ms_handle_refused(Connection *con); + void ms_handle_connect(Connection *con) override; + bool ms_handle_reset(Connection *con) override; + void ms_handle_remote_reset(Connection *con) override; + bool ms_handle_refused(Connection *con) override; bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, - bool force_new); + bool force_new) override; void blacklist_self(bool set);