From 6a640d997dd8768664353ca3de4c436d398bdeb5 Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Wed, 15 Feb 2017 21:26:08 +0800 Subject: [PATCH] mds: add override in mds subsystem Fixes: http://tracker.ceph.com/issues/18922 Signed-off-by: liuchang0812 --- src/mds/Beacon.cc | 2 +- src/mds/CDir.cc | 10 +++--- src/mds/CInode.cc | 14 ++++---- src/mds/DamageTable.cc | 12 +++---- src/mds/Locker.cc | 20 +++++------ src/mds/MDBalancer.cc | 2 +- src/mds/MDCache.cc | 70 +++++++++++++++++++-------------------- src/mds/MDLog.cc | 12 +++---- src/mds/MDSDaemon.cc | 10 +++--- src/mds/MDSRank.cc | 10 +++--- src/mds/MDSTable.cc | 6 ++-- src/mds/MDSTableClient.cc | 4 +-- src/mds/MDSTableServer.cc | 8 ++--- src/mds/Migrator.cc | 18 +++++----- src/mds/RecoveryQueue.cc | 4 +-- src/mds/ScrubStack.cc | 2 +- src/mds/Server.cc | 58 ++++++++++++++++---------------- src/mds/SessionMap.cc | 10 +++--- src/mds/SnapRealm.cc | 4 +-- src/mds/StrayManager.cc | 20 +++++------ 20 files changed, 148 insertions(+), 148 deletions(-) diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index c8a88de7170b1..210de4ee6c7c8 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -36,7 +36,7 @@ class Beacon::C_MDS_BeaconSender : public Context { public: explicit C_MDS_BeaconSender(Beacon *beacon_) : beacon(beacon_) {} - void finish(int r) { + void finish(int r) override { assert(beacon->lock.is_locked_by_me()); beacon->sender = NULL; beacon->_send(); diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 6ad74bdf30db1..1faa02e4e9370 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -49,7 +49,7 @@ class CDirContext : public MDSInternalContextBase { protected: CDir *dir; - MDSRank* get_mds() {return dir->cache->mds;} + MDSRank* get_mds() override {return dir->cache->mds;} public: explicit CDirContext(CDir *d) : dir(d) { @@ -62,7 +62,7 @@ class CDirIOContext : public MDSIOContextBase { protected: CDir *dir; - MDSRank* get_mds() {return dir->cache->mds;} + MDSRank* get_mds() override {return dir->cache->mds;} public: explicit CDirIOContext(CDir *d) : dir(d) { @@ -1494,7 +1494,7 @@ class C_IO_Dir_OMAP_Fetched : public CDirIOContext { C_IO_Dir_OMAP_Fetched(CDir *d, MDSInternalContextBase *f) : CDirIOContext(d), fin(f), ret1(0), ret2(0), ret3(0) { } - void finish(int r) { + void finish(int r) override { // check the correctness of backtrace if (r >= 0 && ret3 != -ECANCELED) dir->inode->verify_diri_backtrace(btbl, ret3); @@ -1975,7 +1975,7 @@ class C_IO_Dir_Committed : public CDirIOContext { version_t version; public: C_IO_Dir_Committed(CDir *d, version_t v) : CDirIOContext(d), version(v) { } - void finish(int r) { + void finish(int r) override { dir->_committed(r, version); } }; @@ -2763,7 +2763,7 @@ CDir *CDir::get_frozen_tree_root() class C_Dir_AuthUnpin : public CDirContext { public: explicit C_Dir_AuthUnpin(CDir *d) : CDirContext(d) {} - void finish(int r) { + void finish(int r) override { dir->auth_unpin(dir->get_inode()); } }; diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index cdc9832d44813..1eebf16456ad7 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -58,7 +58,7 @@ class CInodeIOContext : public MDSIOContextBase { protected: CInode *in; - MDSRank *get_mds() {return in->mdcache->mds;} + MDSRank *get_mds() override {return in->mdcache->mds;} public: explicit CInodeIOContext(CInode *in_) : in(in_) { assert(in != NULL); @@ -943,7 +943,7 @@ struct C_IO_Inode_Stored : public CInodeIOContext { version_t version; Context *fin; C_IO_Inode_Stored(CInode *i, version_t v, Context *f) : CInodeIOContext(i), version(v), fin(f) {} - void finish(int r) { + void finish(int r) override { in->_stored(r, version, fin); } }; @@ -1033,7 +1033,7 @@ struct C_IO_Inode_Fetched : public CInodeIOContext { bufferlist bl, bl2; Context *fin; C_IO_Inode_Fetched(CInode *i, Context *f) : CInodeIOContext(i), fin(f) {} - void finish(int r) { + void finish(int r) override { // Ignore 'r', because we fetch from two places, so r is usually ENOENT in->_fetched(bl, bl2, fin); } @@ -1126,7 +1126,7 @@ struct C_IO_Inode_StoredBacktrace : public CInodeIOContext { version_t version; Context *fin; C_IO_Inode_StoredBacktrace(CInode *i, version_t v, Context *f) : CInodeIOContext(i), version(v), fin(f) {} - void finish(int r) { + void finish(int r) override { in->_stored_backtrace(r, version, fin); } }; @@ -1866,8 +1866,8 @@ class C_Inode_FragUpdate : public MDSLogContextBase { CInode *in; CDir *dir; MutationRef mut; - MDSRank *get_mds() {return in->mdcache->mds;} - void finish(int r) { + MDSRank *get_mds() override {return in->mdcache->mds;} + void finish(int r) override { in->_finish_frag_update(dir, mut); } @@ -4016,7 +4016,7 @@ void CInode::validate_disk_state(CInode::validated_data *results, return true; } - void _done() { + void _done() override { if ((!results->raw_stats.checked || results->raw_stats.passed) && (!results->backtrace.checked || results->backtrace.passed) && (!results->inode.checked || results->inode.passed)) diff --git a/src/mds/DamageTable.cc b/src/mds/DamageTable.cc index c19f4e2c93ee1..3e651097d0273 100644 --- a/src/mds/DamageTable.cc +++ b/src/mds/DamageTable.cc @@ -38,12 +38,12 @@ class DirFragDamage : public DamageEntry : ino(ino_), frag(frag_) {} - virtual damage_entry_type_t get_type() const + damage_entry_type_t get_type() const override { return DAMAGE_ENTRY_DIRFRAG; } - void dump(Formatter *f) const + void dump(Formatter *f) const override { f->open_object_section("dir_frag_damage"); f->dump_string("damage_type", "dir_frag"); @@ -74,12 +74,12 @@ class DentryDamage : public DamageEntry : ino(ino_), frag(frag_), dname(dname_), snap_id(snap_id_) {} - virtual damage_entry_type_t get_type() const + damage_entry_type_t get_type() const override { return DAMAGE_ENTRY_DENTRY; } - void dump(Formatter *f) const + void dump(Formatter *f) const override { f->open_object_section("dentry_damage"); f->dump_string("damage_type", "dentry"); @@ -105,12 +105,12 @@ class BacktraceDamage : public DamageEntry : ino(ino_) {} - virtual damage_entry_type_t get_type() const + damage_entry_type_t get_type() const override { return DAMAGE_ENTRY_BACKTRACE; } - void dump(Formatter *f) const + void dump(Formatter *f) const override { f->open_object_section("backtrace_damage"); f->dump_string("damage_type", "backtrace"); diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 95a1f24d08ce3..ada7611b4a046 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -59,7 +59,7 @@ static ostream& _prefix(std::ostream *_dout, MDSRank *mds) { class LockerContext : public MDSInternalContextBase { protected: Locker *locker; - MDSRank *get_mds() + MDSRank *get_mds() override { return locker->mds; } @@ -73,7 +73,7 @@ class LockerContext : public MDSInternalContextBase { class LockerLogContext : public MDSLogContextBase { protected: Locker *locker; - MDSRank *get_mds() + MDSRank *get_mds() override { return locker->mds; } @@ -1006,7 +1006,7 @@ class C_Locker_Eval : public LockerContext { assert(locker->mds->mds_lock.is_locked_by_me()); p->get(MDSCacheObject::PIN_PTRWAITER); } - void finish(int r) { + void finish(int r) override { p->put(MDSCacheObject::PIN_PTRWAITER); locker->try_eval(p, mask); } @@ -1717,7 +1717,7 @@ class C_Locker_FileUpdate_finish : public LockerLogContext { ack(ac) { in->get(CInode::PIN_PTRWAITER); } - void finish(int r) { + void finish(int r) override { locker->file_update_finish(in, mut, share, client, cap, ack); } }; @@ -2094,7 +2094,7 @@ class C_MDL_RequestInodeFileCaps : public LockerContext { C_MDL_RequestInodeFileCaps(Locker *l, CInode *i) : LockerContext(l), in(i) { in->get(CInode::PIN_PTRWAITER); } - void finish(int r) { + void finish(int r) override { in->put(CInode::PIN_PTRWAITER); if (!in->is_auth()) locker->request_inode_file_caps(in); @@ -2171,7 +2171,7 @@ class C_MDL_CheckMaxSize : public LockerContext { { in->get(CInode::PIN_PTRWAITER); } - void finish(int r) { + void finish(int r) override { in->put(CInode::PIN_PTRWAITER); if (in->is_auth()) locker->check_inode_max_size(in, false, new_max_size, newsize, mtime); @@ -2789,7 +2789,7 @@ class C_Locker_RetryRequestCapRelease : public LockerContext { public: C_Locker_RetryRequestCapRelease(Locker *l, client_t c, const ceph_mds_request_release& it) : LockerContext(l), client(c), item(it) { } - void finish(int r) { + void finish(int r) override { string dname; MDRequestRef null_ref; locker->process_request_cap_release(null_ref, client, item, dname); @@ -2889,7 +2889,7 @@ class C_Locker_RetryKickIssueCaps : public LockerContext { LockerContext(l), in(i), client(c), seq(s) { in->get(CInode::PIN_PTRWAITER); } - void finish(int r) { + void finish(int r) override { locker->kick_issue_caps(in, client, seq); in->put(CInode::PIN_PTRWAITER); } @@ -3348,7 +3348,7 @@ class C_Locker_RetryCapRelease : public LockerContext { C_Locker_RetryCapRelease(Locker *l, client_t c, inodeno_t i, uint64_t id, ceph_seq_t mseq, ceph_seq_t seq) : LockerContext(l), client(c), ino(i), cap_id(id), migrate_seq(mseq), issue_seq(seq) {} - void finish(int r) { + void finish(int r) override { locker->_do_cap_release(client, ino, cap_id, migrate_seq, issue_seq); } }; @@ -4244,7 +4244,7 @@ class C_Locker_ScatterWB : public LockerLogContext { public: C_Locker_ScatterWB(Locker *l, ScatterLock *sl, MutationRef& m) : LockerLogContext(l), lock(sl), mut(m) {} - void finish(int r) { + void finish(int r) override { locker->scatter_writebehind_finish(lock, mut); } }; diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index f3df8f1d2d2ec..afe4296f179f6 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -107,7 +107,7 @@ void MDBalancer::tick() class C_Bal_SendHeartbeat : public MDSInternalContext { public: explicit C_Bal_SendHeartbeat(MDSRank *mds_) : MDSInternalContext(mds_) { } - virtual void finish(int f) { + void finish(int f) override { mds->balancer->send_heartbeat(); } }; diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index fb9b92145474e..e5773dd30e822 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -136,7 +136,7 @@ set SimpleLock::empty_gather_set; class MDCacheContext : public virtual MDSInternalContextBase { protected: MDCache *mdcache; - virtual MDSRank *get_mds() + MDSRank *get_mds() override { assert(mdcache != NULL); return mdcache->mds; @@ -156,7 +156,7 @@ class MDCacheContext : public virtual MDSInternalContextBase { class MDCacheIOContext : public virtual MDSIOContextBase { protected: MDCache *mdcache; - virtual MDSRank *get_mds() + MDSRank *get_mds() override { assert(mdcache != NULL); return mdcache->mds; @@ -168,7 +168,7 @@ class MDCacheIOContext : public virtual MDSIOContextBase { class MDCacheLogContext : public virtual MDSLogContextBase { protected: MDCache *mdcache; - virtual MDSRank *get_mds() + MDSRank *get_mds() override { assert(mdcache != NULL); return mdcache->mds; @@ -486,7 +486,7 @@ struct C_MDC_CreateSystemFile : public MDCacheLogContext { MDSInternalContextBase *fin; C_MDC_CreateSystemFile(MDCache *c, MutationRef& mu, CDentry *d, version_t v, MDSInternalContextBase *f) : MDCacheLogContext(c), mut(mu), dn(d), dpv(v), fin(f) {} - void finish(int r) { + void finish(int r) override { mdcache->_create_system_file_finish(mut, dn, dpv, fin); } }; @@ -573,7 +573,7 @@ void MDCache::_create_system_file_finish(MutationRef& mut, CDentry *dn, version_ struct C_MDS_RetryOpenRoot : public MDSInternalContext { MDCache *cache; explicit C_MDS_RetryOpenRoot(MDCache *c) : MDSInternalContext(c->mds), cache(c) {} - void finish(int r) { + void finish(int r) override { if (r < 0) { // If we can't open root, something disastrous has happened: mark // this rank damaged for operator intervention. Note that @@ -896,7 +896,7 @@ class C_MDC_SubtreeMergeWB : public MDCacheLogContext { MutationRef mut; public: C_MDC_SubtreeMergeWB(MDCache *mdc, CInode *i, MutationRef& m) : MDCacheLogContext(mdc), in(i), mut(m) {} - void finish(int r) { + void finish(int r) override { mdcache->subtree_merge_writebehind_finish(in, mut); } }; @@ -2384,7 +2384,7 @@ void MDCache::predirty_journal_parents(MutationRef mut, EMetaBlob *blob, struct C_MDC_CommittedMaster : public MDCacheLogContext { metareqid_t reqid; C_MDC_CommittedMaster(MDCache *s, metareqid_t r) : MDCacheLogContext(s), reqid(r) {} - void finish(int r) { + void finish(int r) override { mdcache->_logged_master_commit(reqid); } }; @@ -2460,7 +2460,7 @@ struct C_MDC_SlaveCommit : public MDCacheLogContext { mds_rank_t from; metareqid_t reqid; C_MDC_SlaveCommit(MDCache *c, int f, metareqid_t r) : MDCacheLogContext(c), from(f), reqid(r) {} - void finish(int r) { + void finish(int r) override { mdcache->_logged_slave_commit(from, reqid); } }; @@ -4504,7 +4504,7 @@ void MDCache::handle_cache_rejoin_weak(MMDSCacheRejoin *weak) class C_MDC_RejoinGatherFinish : public MDCacheContext { public: explicit C_MDC_RejoinGatherFinish(MDCache *c) : MDCacheContext(c) {} - void finish(int r) { + void finish(int r) override { mdcache->rejoin_gather_finish(); } }; @@ -5206,7 +5206,7 @@ class C_MDC_RejoinOpenInoFinish: public MDCacheContext { inodeno_t ino; public: C_MDC_RejoinOpenInoFinish(MDCache *c, inodeno_t i) : MDCacheContext(c), ino(i) {} - void finish(int r) { + void finish(int r) override { mdcache->rejoin_open_ino_finish(ino, r); } }; @@ -5248,7 +5248,7 @@ class C_MDC_RejoinSessionsOpened : public MDCacheLogContext { C_MDC_RejoinSessionsOpened(MDCache *c, map& cm) : MDCacheLogContext(c), client_map(cm) {} - void finish(int r) { + void finish(int r) override { assert(r == 0); mdcache->rejoin_open_sessions_finish(client_map, sseqmap); } @@ -5719,7 +5719,7 @@ void MDCache::do_delayed_cap_imports() struct C_MDC_OpenSnapParents : public MDCacheContext { explicit C_MDC_OpenSnapParents(MDCache *c) : MDCacheContext(c) {} - void finish(int r) { + void finish(int r) override { mdcache->open_snap_parents(); } }; @@ -6059,7 +6059,7 @@ struct C_MDC_QueuedCow : public MDCacheContext { MutationRef mut; C_MDC_QueuedCow(MDCache *mdc, CInode *i, MutationRef& m) : MDCacheContext(mdc), in(i), mut(m) {} - void finish(int r) { + void finish(int r) override { mdcache->_queued_file_recover_cow(in, mut); } }; @@ -6200,7 +6200,7 @@ class C_MDC_RetryTruncate : public MDCacheContext { public: C_MDC_RetryTruncate(MDCache *c, CInode *i, LogSegment *l) : MDCacheContext(c), in(i), ls(l) {} - void finish(int r) { + void finish(int r) override { mdcache->_truncate_inode(in, ls); } }; @@ -6233,7 +6233,7 @@ struct C_IO_MDC_TruncateFinish : public MDCacheIOContext { LogSegment *ls; C_IO_MDC_TruncateFinish(MDCache *c, CInode *i, LogSegment *l) : MDCacheIOContext(c), in(i), ls(l) {} - void finish(int r) { + void finish(int r) override { assert(r == 0 || r == -ENOENT); mdcache->truncate_inode_finish(in, ls); } @@ -6276,7 +6276,7 @@ struct C_MDC_TruncateLogged : public MDCacheLogContext { MutationRef mut; C_MDC_TruncateLogged(MDCache *m, CInode *i, MutationRef& mu) : MDCacheLogContext(m), in(i), mut(mu) {} - void finish(int r) { + void finish(int r) override { mdcache->truncate_inode_logged(in, mut); } }; @@ -7421,7 +7421,7 @@ void MDCache::check_memory_usage() class C_MDC_ShutdownCheck : public MDCacheContext { public: explicit C_MDC_ShutdownCheck(MDCache *m) : MDCacheContext(m) {} - void finish(int) { + void finish(int) override { mdcache->shutdown_check(); } }; @@ -8231,7 +8231,7 @@ struct C_MDC_OpenRemoteDentry : public MDCacheContext { bool want_xlocked; C_MDC_OpenRemoteDentry(MDCache *m, CDentry *d, inodeno_t i, MDSInternalContextBase *f, bool wx) : MDCacheContext(m), dn(d), ino(i), onfinish(f), want_xlocked(wx) {} - void finish(int r) { + void finish(int r) override { mdcache->_open_remote_dentry_finish(dn, ino, onfinish, want_xlocked, r); } }; @@ -8288,7 +8288,7 @@ class C_IO_MDC_OpenInoBacktraceFetched : public MDCacheIOContext { bufferlist bl; C_IO_MDC_OpenInoBacktraceFetched(MDCache *c, inodeno_t i) : MDCacheIOContext(c), ino(i) {} - void finish(int r) { + void finish(int r) override { mdcache->_open_ino_backtrace_fetched(ino, bl, r); } }; @@ -8300,7 +8300,7 @@ struct C_MDC_OpenInoTraverseDir : public MDCacheContext { public: C_MDC_OpenInoTraverseDir(MDCache *c, inodeno_t i, MMDSOpenIno *m, bool p) : MDCacheContext(c), ino(i), msg(m), parent(p) {} - void finish(int r) { + void finish(int r) override { if (r < 0 && !parent) r = -EAGAIN; if (msg) { @@ -8316,7 +8316,7 @@ struct C_MDC_OpenInoParentOpened : public MDCacheContext { inodeno_t ino; public: C_MDC_OpenInoParentOpened(MDCache *c, inodeno_t i) : MDCacheContext(c), ino(i) {} - void finish(int r) { + void finish(int r) override { mdcache->_open_ino_parent_opened(ino, r); } }; @@ -9220,7 +9220,7 @@ struct C_MDC_snaprealm_create_finish : public MDCacheLogContext { C_MDC_snaprealm_create_finish(MDCache *c, MDRequestRef& m, MutationRef& mu, CInode *i) : MDCacheLogContext(c), mdr(m), mut(mu), in(i) {} - void finish(int r) { + void finish(int r) override { mdcache->_snaprealm_create_finish(mdr, mut, in); } }; @@ -9415,7 +9415,7 @@ void MDCache::_snaprealm_create_finish(MDRequestRef& mdr, MutationRef& mut, CIno struct C_MDC_RetryScanStray : public MDCacheContext { dirfrag_t next; C_MDC_RetryScanStray(MDCache *c, dirfrag_t n) : MDCacheContext(c), next(n) { } - void finish(int r) { + void finish(int r) override { mdcache->scan_stray_dir(next); } }; @@ -9582,7 +9582,7 @@ struct C_MDC_RetryDiscoverPath : public MDCacheContext { mds_rank_t from; C_MDC_RetryDiscoverPath(MDCache *c, CInode *b, snapid_t s, filepath &p, mds_rank_t f) : MDCacheContext(c), base(b), snapid(s), path(p), from(f) {} - void finish(int r) { + void finish(int r) override { mdcache->discover_path(base, snapid, path, 0, from); } }; @@ -9639,7 +9639,7 @@ struct C_MDC_RetryDiscoverPath2 : public MDCacheContext { filepath path; C_MDC_RetryDiscoverPath2(MDCache *c, CDir *b, snapid_t s, filepath &p) : MDCacheContext(c), base(b), snapid(s), path(p) {} - void finish(int r) { + void finish(int r) override { mdcache->discover_path(base, snapid, path, 0); } }; @@ -10738,7 +10738,7 @@ class C_MDC_FragmentFrozen : public MDSInternalContext { public: C_MDC_FragmentFrozen(MDCache *m, MDRequestRef& r) : MDSInternalContext(m->mds), mdcache(m), mdr(r) {} - virtual void finish(int r) { + void finish(int r) override { mdcache->fragment_frozen(mdr, r); } }; @@ -10874,7 +10874,7 @@ class C_MDC_FragmentMarking : public MDCacheContext { MDRequestRef mdr; public: C_MDC_FragmentMarking(MDCache *m, MDRequestRef& r) : MDCacheContext(m), mdr(r) {} - virtual void finish(int r) { + void finish(int r) override { mdcache->fragment_mark_and_complete(mdr); } }; @@ -11076,7 +11076,7 @@ class C_MDC_FragmentPrep : public MDCacheLogContext { MDRequestRef mdr; public: C_MDC_FragmentPrep(MDCache *m, MDRequestRef& r) : MDCacheLogContext(m), mdr(r) {} - virtual void finish(int r) { + void finish(int r) override { mdcache->_fragment_logged(mdr); } }; @@ -11085,7 +11085,7 @@ class C_MDC_FragmentStore : public MDCacheContext { MDRequestRef mdr; public: C_MDC_FragmentStore(MDCache *m, MDRequestRef& r) : MDCacheContext(m), mdr(r) {} - virtual void finish(int r) { + void finish(int r) override { mdcache->_fragment_stored(mdr); } }; @@ -11096,7 +11096,7 @@ class C_MDC_FragmentCommit : public MDCacheLogContext { public: C_MDC_FragmentCommit(MDCache *m, dirfrag_t df, list& l) : MDCacheLogContext(m), basedirfrag(df), resultfrags(l) {} - virtual void finish(int r) { + void finish(int r) override { mdcache->_fragment_committed(basedirfrag, resultfrags); } }; @@ -11109,7 +11109,7 @@ class C_IO_MDC_FragmentFinish : public MDCacheIOContext { MDCacheIOContext(m), basedirfrag(f) { resultfrags.swap(l); } - virtual void finish(int r) { + void finish(int r) override { assert(r == 0 || r == -ENOENT); mdcache->_fragment_finish(basedirfrag, resultfrags); } @@ -11972,7 +11972,7 @@ class C_MDS_EnqueueScrub : public Context return fin; } - void finish(int r) { + void finish(int r) override { if (r < 0) { // we failed the lookup or something; dump ourselves formatter->open_object_section("results"); formatter->dump_int("return_code", r); @@ -12046,7 +12046,7 @@ struct C_MDC_RepairDirfragStats : public MDCacheLogContext { MDRequestRef mdr; C_MDC_RepairDirfragStats(MDCache *c, MDRequestRef& m) : MDCacheLogContext(c), mdr(m) {} - void finish(int r) { + void finish(int r) override { mdr->apply(); get_mds()->server->respond_to_request(mdr, r); } @@ -12266,10 +12266,10 @@ class C_FinishIOMDR : public MDSInternalContextBase { protected: MDSRank *mds; MDRequestRef mdr; - MDSRank *get_mds() { return mds; } + MDSRank *get_mds() override { return mds; } public: C_FinishIOMDR(MDSRank *mds_, MDRequestRef& mdr_) : mds(mds_), mdr(mdr_) {} - void finish(int r) { mds->server->respond_to_request(mdr, r); } + void finish(int r) override { mds->server->respond_to_request(mdr, r); } }; void MDCache::flush_dentry_work(MDRequestRef& mdr) diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index e3d5ab724ef53..87fe65c03fc58 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -91,9 +91,9 @@ void MDLog::set_write_iohint(unsigned iohint_flags) class C_MDL_WriteError : public MDSIOContextBase { protected: MDLog *mdlog; - MDSRank *get_mds() {return mdlog->mds;} + MDSRank *get_mds() override {return mdlog->mds;} - void finish(int r) { + void finish(int r) override { MDSRank *mds = get_mds(); // assume journal is reliable, so don't choose action based on // g_conf->mds_action_on_write_error. @@ -202,7 +202,7 @@ class C_ReopenComplete : public MDSInternalContext { MDSInternalContextBase *on_complete; public: C_ReopenComplete(MDLog *mdlog_, MDSInternalContextBase *on_complete_) : MDSInternalContext(mdlog_->mds), mdlog(mdlog_), on_complete(on_complete_) {} - void finish(int r) { + void finish(int r) override { mdlog->append(); on_complete->complete(r); } @@ -339,10 +339,10 @@ void MDLog::_submit_entry(LogEvent *le, MDSLogContextBase *c) class C_MDL_Flushed : public MDSLogContextBase { protected: MDLog *mdlog; - MDSRank *get_mds() {return mdlog->mds;} + MDSRank *get_mds() override {return mdlog->mds;} MDSInternalContextBase *wrapped; - void finish(int r) { + void finish(int r) override { if (wrapped) wrapped->complete(r); } @@ -678,7 +678,7 @@ class C_MaybeExpiredSegment : public MDSInternalContext { public: C_MaybeExpiredSegment(MDLog *mdl, LogSegment *s, int p) : MDSInternalContext(mdl->mds), mdlog(mdl), ls(s), op_prio(p) {} - void finish(int res) { + void finish(int res) override { if (res < 0) mdlog->mds->handle_write_error(res); mdlog->_maybe_expired(ls, op_prio); diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index 58f59f60a6388..14b4939fce77d 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -85,7 +85,7 @@ class C_VoidFn : public Context assert(fn_); } - void finish(int r) + void finish(int r) override { (mds->*fn)(); } @@ -96,7 +96,7 @@ class MDSDaemon::C_MDS_Tick : public Context { MDSDaemon *mds_daemon; public: explicit C_MDS_Tick(MDSDaemon *m) : mds_daemon(m) {} - void finish(int r) { + void finish(int r) override { assert(mds_daemon->mds_lock.is_locked_by_me()); mds_daemon->tick_event = 0; @@ -155,7 +155,7 @@ class MDSSocketHook : public AdminSocketHook { public: explicit MDSSocketHook(MDSDaemon *m) : mds(m) {} bool call(std::string command, cmdmap_t& cmdmap, std::string format, - bufferlist& out) { + bufferlist& out) override { stringstream ss; bool r = mds->asok_command(command, cmdmap, format, ss); out.append(ss); @@ -716,7 +716,7 @@ int MDSDaemon::_handle_command( public: explicit SuicideLater(MDSDaemon *mds_) : mds(mds_) {} - void finish(int r) { + void finish(int r) override { // Wait a little to improve chances of caller getting // our response before seeing us disappear from mdsmap sleep(1); @@ -733,7 +733,7 @@ int MDSDaemon::_handle_command( public: explicit RespawnLater(MDSDaemon *mds_) : mds(mds_) {} - void finish(int r) { + void finish(int r) override { // Wait a little to improve chances of caller getting // our response before seeing us disappear from mdsmap sleep(1); diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 36c0947d98b95..0264ae412e04e 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -284,7 +284,7 @@ class C_MDS_VoidFn : public MDSInternalContext assert(fn_); } - void finish(int r) + void finish(int r) override { (mds->*fn)(); } @@ -907,7 +907,7 @@ class C_MDS_BootStart : public MDSInternalContext { public: C_MDS_BootStart(MDSRank *m, MDSRank::BootStep n) : MDSInternalContext(m), nextstep(n) {} - void finish(int r) { + void finish(int r) override { mds->boot_start(nextstep, r); } }; @@ -1055,7 +1055,7 @@ class MDSRank::C_MDS_StandbyReplayRestartFinish : public MDSIOContext { public: C_MDS_StandbyReplayRestartFinish(MDSRank *mds_, uint64_t old_read_pos_) : MDSIOContext(mds_), old_read_pos(old_read_pos_) {} - void finish(int r) { + void finish(int r) override { mds->_standby_replay_restart_finish(r, old_read_pos); } }; @@ -1104,7 +1104,7 @@ inline void MDSRank::standby_replay_restart() class MDSRank::C_MDS_StandbyReplayRestart : public MDSInternalContext { public: explicit C_MDS_StandbyReplayRestart(MDSRank *m) : MDSInternalContext(m) {} - void finish(int r) { + void finish(int r) override { assert(!r); mds->standby_replay_restart(); } @@ -1788,7 +1788,7 @@ class C_MDS_Send_Command_Reply : public MDSInternalContext MDSDaemon::send_command_reply(m, mds, r, bl, out_str); m->put(); } - void finish (int r) { + void finish (int r) override { send(r, ""); } }; diff --git a/src/mds/MDSTable.cc b/src/mds/MDSTable.cc index 4dff77aac01b8..937ae41abc29f 100644 --- a/src/mds/MDSTable.cc +++ b/src/mds/MDSTable.cc @@ -38,7 +38,7 @@ class MDSTableIOContext : public MDSIOContextBase { protected: MDSTable *ida; - MDSRank *get_mds() {return ida->mds;} + MDSRank *get_mds() override {return ida->mds;} public: explicit MDSTableIOContext(MDSTable *ida_) : ida(ida_) { assert(ida != NULL); @@ -50,7 +50,7 @@ class C_IO_MT_Save : public MDSTableIOContext { version_t version; public: C_IO_MT_Save(MDSTable *i, version_t v) : MDSTableIOContext(i), version(v) {} - void finish(int r) { + void finish(int r) override { ida->save_2(r, version); } }; @@ -125,7 +125,7 @@ class C_IO_MT_Load : public MDSTableIOContext { Context *onfinish; bufferlist bl; C_IO_MT_Load(MDSTable *i, Context *o) : MDSTableIOContext(i), onfinish(o) {} - void finish(int r) { + void finish(int r) override { ida->load_2(r, bl, onfinish); } }; diff --git a/src/mds/MDSTableClient.cc b/src/mds/MDSTableClient.cc index 8d66116c23b17..7d0353e61d2e6 100644 --- a/src/mds/MDSTableClient.cc +++ b/src/mds/MDSTableClient.cc @@ -39,10 +39,10 @@ class C_LoggedAck : public MDSLogContextBase { MDSTableClient *tc; version_t tid; - MDSRank *get_mds() { return tc->mds; } + MDSRank *get_mds() override { return tc->mds; } public: C_LoggedAck(MDSTableClient *a, version_t t) : tc(a), tid(t) {} - void finish(int r) { + void finish(int r) override { tc->_logged_ack(tid); } }; diff --git a/src/mds/MDSTableServer.cc b/src/mds/MDSTableServer.cc index 83987e8e07cae..4552a469637ac 100644 --- a/src/mds/MDSTableServer.cc +++ b/src/mds/MDSTableServer.cc @@ -42,11 +42,11 @@ class C_Prepare : public MDSLogContextBase { MDSTableServer *server; MMDSTableRequest *req; version_t tid; - MDSRank *get_mds() { return server->mds; } + MDSRank *get_mds() override { return server->mds; } public: C_Prepare(MDSTableServer *s, MMDSTableRequest *r, version_t v) : server(s), req(r), tid(v) {} - void finish(int r) { + void finish(int r) override { server->_prepare_logged(req, tid); } }; @@ -86,10 +86,10 @@ void MDSTableServer::_prepare_logged(MMDSTableRequest *req, version_t tid) class C_Commit : public MDSLogContextBase { MDSTableServer *server; MMDSTableRequest *req; - MDSRank *get_mds() { return server->mds; } + MDSRank *get_mds() override { return server->mds; } public: C_Commit(MDSTableServer *s, MMDSTableRequest *r) : server(s), req(r) {} - void finish(int r) { + void finish(int r) override { server->_commit_logged(req); } }; diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 2459af1bba36c..95e1c89c02218 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -87,7 +87,7 @@ class MigratorContext : public MDSInternalContextBase { protected: Migrator *mig; - MDSRank *get_mds() { + MDSRank *get_mds() override { return mig->mds; } public: @@ -99,7 +99,7 @@ class MigratorContext : public MDSInternalContextBase { class MigratorLogContext : public MDSLogContextBase { protected: Migrator *mig; - MDSRank *get_mds() { + MDSRank *get_mds() override { return mig->mds; } public: @@ -167,7 +167,7 @@ class C_MDC_EmptyImport : public MigratorContext { CDir *dir; public: C_MDC_EmptyImport(Migrator *m, CDir *d) : MigratorContext(m), dir(d) {} - void finish(int r) { + void finish(int r) override { mig->export_empty_import(dir); } }; @@ -692,7 +692,7 @@ class C_MDC_ExportFreeze : public MigratorContext { MigratorContext(m), ex(e), tid(t) { assert(ex != NULL); } - virtual void finish(int r) { + void finish(int r) override { if (r >= 0) mig->export_frozen(ex, tid); } @@ -892,7 +892,7 @@ class C_M_ExportSessionsFlushed : public MigratorContext { : MigratorContext(m), dir(d), tid(t) { assert(dir != NULL); } - void finish(int r) { + void finish(int r) override { mig->export_sessions_flushed(dir, tid); } }; @@ -1190,7 +1190,7 @@ class C_M_ExportGo : public MigratorContext { MigratorContext(m), dir(d), tid(t) { assert(dir != NULL); } - void finish(int r) { + void finish(int r) override { mig->export_go_synced(dir, tid); } }; @@ -1544,7 +1544,7 @@ class C_MDS_ExportFinishLogged : public MigratorLogContext { CDir *dir; public: C_MDS_ExportFinishLogged(Migrator *m, CDir *d) : MigratorLogContext(m), dir(d) {} - void finish(int r) { + void finish(int r) override { mig->export_logged_finish(dir); } }; @@ -2229,7 +2229,7 @@ class C_MDS_ImportDirLoggedStart : public MigratorLogContext { C_MDS_ImportDirLoggedStart(Migrator *m, CDir *d, mds_rank_t f) : MigratorLogContext(m), df(d->dirfrag()), dir(d), from(f) { } - void finish(int r) { + void finish(int r) override { mig->import_logged_start(df, dir, from, imported_client_map, sseqmap); } }; @@ -3084,7 +3084,7 @@ class C_M_LoggedImportCaps : public MigratorLogContext { map sseqmap; C_M_LoggedImportCaps(Migrator *m, CInode *i, mds_rank_t f) : MigratorLogContext(m), in(i), from(f) {} - void finish(int r) { + void finish(int r) override { mig->logged_import_caps(in, from, peer_exports, client_map, sseqmap); } }; diff --git a/src/mds/RecoveryQueue.cc b/src/mds/RecoveryQueue.cc index 9f1f236fa9614..b0dec74b3a644 100644 --- a/src/mds/RecoveryQueue.cc +++ b/src/mds/RecoveryQueue.cc @@ -30,11 +30,11 @@ class C_MDC_Recover : public MDSIOContextBase { protected: RecoveryQueue *rq; CInode *in; - void finish(int r) { + void finish(int r) override { rq->_recovered(in, r, size, mtime); } - MDSRank *get_mds() { + MDSRank *get_mds() override { return rq->mds; } diff --git a/src/mds/ScrubStack.cc b/src/mds/ScrubStack.cc index ab23531c92e12..f351597290911 100644 --- a/src/mds/ScrubStack.cc +++ b/src/mds/ScrubStack.cc @@ -256,7 +256,7 @@ class C_InodeValidated : public MDSInternalContext : MDSInternalContext(mds), stack(stack_), target(target_) {} - void finish(int r) + void finish(int r) override { stack->_validate_inode_done(target, r, result); } diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 539b7a8108340..ea79583496066 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -75,7 +75,7 @@ using namespace std; class ServerContext : public MDSInternalContextBase { protected: Server *server; - MDSRank *get_mds() + MDSRank *get_mds() override { return server->mds; } @@ -89,13 +89,13 @@ class ServerContext : public MDSInternalContextBase { class ServerLogContext : public MDSLogContextBase { protected: Server *server; - MDSRank *get_mds() + MDSRank *get_mds() override { return server->mds; } MDRequestRef mdr; - void pre_finish(int r) { + void pre_finish(int r) override { if (mdr) mdr->mark_event("journal_committed: "); } @@ -240,7 +240,7 @@ class C_MDS_session_finish : public ServerLogContext { ServerLogContext(srv), session(se), state_seq(sseq), open(s), cmapv(mv), inotablev(0), fin(fin_) { } C_MDS_session_finish(Server *srv, Session *se, uint64_t sseq, bool s, version_t mv, interval_set& i, version_t iv, Context *fin_ = NULL) : ServerLogContext(srv), session(se), state_seq(sseq), open(s), cmapv(mv), inos(i), inotablev(iv), fin(fin_) { } - void finish(int r) { + void finish(int r) override { assert(r == 0); server->_session_logged(session, state_seq, open, cmapv, inos, inotablev); if (fin) { @@ -585,7 +585,7 @@ void Server::finish_force_open_sessions(map& cm, } class C_MDS_TerminatedSessions : public ServerContext { - void finish(int r) { + void finish(int r) override { server->terminating_sessions = false; } public: @@ -2451,7 +2451,7 @@ class C_MDS_TryFindInode : public ServerContext { MDRequestRef mdr; public: C_MDS_TryFindInode(Server *s, MDRequestRef& r) : ServerContext(s), mdr(r) {} - virtual void finish(int r) { + void finish(int r) override { if (r == -ESTALE) // :( find_ino_peers failed server->respond_to_request(mdr, r); else @@ -2798,7 +2798,7 @@ void Server::handle_client_getattr(MDRequestRef& mdr, bool is_lookup) struct C_MDS_LookupIno2 : public ServerContext { MDRequestRef mdr; C_MDS_LookupIno2(Server *s, MDRequestRef& r) : ServerContext(s), mdr(r) {} - void finish(int r) { + void finish(int r) override { server->_lookup_ino_2(mdr, r); } }; @@ -3115,7 +3115,7 @@ class C_MDS_openc_finish : public ServerLogContext { public: C_MDS_openc_finish(Server *s, MDRequestRef& r, CDentry *d, CInode *ni, snapid_t f) : ServerLogContext(s, r), dn(d), newi(ni), follows(f) {} - void finish(int r) { + void finish(int r) override { assert(r == 0); dn->pop_projected_linkage(); @@ -3576,7 +3576,7 @@ class C_MDS_inode_update_finish : public ServerLogContext { C_MDS_inode_update_finish(Server *s, MDRequestRef& r, CInode *i, bool sm=false, bool cr=false) : ServerLogContext(s, r), in(i), truncating_smaller(sm), changed_ranges(cr) { } - void finish(int r) { + void finish(int r) override { assert(r == 0); // apply @@ -4485,7 +4485,7 @@ class C_MDS_inode_xattr_update_finish : public ServerLogContext { C_MDS_inode_xattr_update_finish(Server *s, MDRequestRef& r, CInode *i) : ServerLogContext(s, r), in(i) { } - void finish(int r) { + void finish(int r) override { assert(r == 0); // apply @@ -4646,7 +4646,7 @@ class C_MDS_mknod_finish : public ServerLogContext { public: C_MDS_mknod_finish(Server *s, MDRequestRef& r, CDentry *d, CInode *ni) : ServerLogContext(s, r), dn(d), newi(ni) {} - void finish(int r) { + void finish(int r) override { assert(r == 0); // link the inode @@ -4988,7 +4988,7 @@ class C_MDS_link_local_finish : public ServerLogContext { version_t dnpv_, version_t tipv_) : ServerLogContext(s, r), dn(d), targeti(ti), dnpv(dnpv_), tipv(tipv_) { } - void finish(int r) { + void finish(int r) override { assert(r == 0); server->_link_local_finish(mdr, dn, targeti, dnpv, tipv); } @@ -5064,7 +5064,7 @@ class C_MDS_link_remote_finish : public ServerLogContext { C_MDS_link_remote_finish(Server *s, MDRequestRef& r, bool i, CDentry *d, CInode *ti) : ServerLogContext(s, r), inc(i), dn(d), targeti(ti), dpv(d->get_projected_version()) {} - void finish(int r) { + void finish(int r) override { assert(r == 0); server->_link_remote_finish(mdr, inc, dn, targeti, dpv); } @@ -5185,7 +5185,7 @@ class C_MDS_SlaveLinkPrep : public ServerLogContext { public: C_MDS_SlaveLinkPrep(Server *s, MDRequestRef& r, CInode *t) : ServerLogContext(s, r), targeti(t) { } - void finish(int r) { + void finish(int r) override { assert(r == 0); server->_logged_slave_link(mdr, targeti); } @@ -5197,7 +5197,7 @@ class C_MDS_SlaveLinkCommit : public ServerContext { public: C_MDS_SlaveLinkCommit(Server *s, MDRequestRef& r, CInode *t) : ServerContext(s), mdr(r), targeti(t) { } - void finish(int r) { + void finish(int r) override { server->_commit_slave_link(mdr, r, targeti); } }; @@ -5304,7 +5304,7 @@ void Server::_logged_slave_link(MDRequestRef& mdr, CInode *targeti) struct C_MDS_CommittedSlave : public ServerLogContext { C_MDS_CommittedSlave(Server *s, MDRequestRef& m) : ServerLogContext(s, m) {} - void finish(int r) { + void finish(int r) override { server->_committed_slave(mdr); } }; @@ -5346,7 +5346,7 @@ void Server::_committed_slave(MDRequestRef& mdr) struct C_MDS_LoggedLinkRollback : public ServerLogContext { MutationRef mut; C_MDS_LoggedLinkRollback(Server *s, MutationRef& m, MDRequestRef& r) : ServerLogContext(s, r), mut(m) {} - void finish(int r) { + void finish(int r) override { server->_link_rollback_finish(mut, mdr); } }; @@ -5617,7 +5617,7 @@ class C_MDS_unlink_local_finish : public ServerLogContext { C_MDS_unlink_local_finish(Server *s, MDRequestRef& r, CDentry *d, CDentry *sd) : ServerLogContext(s, r), dn(d), straydn(sd), dnpv(d->get_projected_version()) {} - void finish(int r) { + void finish(int r) override { assert(r == 0); server->_unlink_local_finish(mdr, dn, straydn, dnpv); } @@ -5787,7 +5787,7 @@ struct C_MDS_SlaveRmdirPrep : public ServerLogContext { CDentry *dn, *straydn; C_MDS_SlaveRmdirPrep(Server *s, MDRequestRef& r, CDentry *d, CDentry *st) : ServerLogContext(s, r), dn(d), straydn(st) {} - void finish(int r) { + void finish(int r) override { server->_logged_slave_rmdir(mdr, dn, straydn); } }; @@ -5796,7 +5796,7 @@ struct C_MDS_SlaveRmdirCommit : public ServerContext { MDRequestRef mdr; C_MDS_SlaveRmdirCommit(Server *s, MDRequestRef& r) : ServerContext(s), mdr(r) { } - void finish(int r) { + void finish(int r) override { server->_commit_slave_rmdir(mdr, r); } }; @@ -5971,7 +5971,7 @@ struct C_MDS_LoggedRmdirRollback : public ServerLogContext { CDentry *straydn; C_MDS_LoggedRmdirRollback(Server *s, MDRequestRef& m, metareqid_t mr, CDentry *d, CDentry *st) : ServerLogContext(s, m), reqid(mr), dn(d), straydn(st) {} - void finish(int r) { + void finish(int r) override { server->_rmdir_rollback_finish(mdr, reqid, dn, straydn); } }; @@ -6137,7 +6137,7 @@ class C_MDS_rename_finish : public ServerLogContext { CDentry *sdn, CDentry *ddn, CDentry *stdn) : ServerLogContext(s, r), srcdn(sdn), destdn(ddn), straydn(stdn) { } - void finish(int r) { + void finish(int r) override { assert(r == 0); server->_rename_finish(mdr, srcdn, destdn, straydn); } @@ -7150,7 +7150,7 @@ class C_MDS_SlaveRenamePrep : public ServerLogContext { public: C_MDS_SlaveRenamePrep(Server *s, MDRequestRef& m, CDentry *sr, CDentry *de, CDentry *st) : ServerLogContext(s, m), srcdn(sr), destdn(de), straydn(st) {} - void finish(int r) { + void finish(int r) override { server->_logged_slave_rename(mdr, srcdn, destdn, straydn); } }; @@ -7161,7 +7161,7 @@ class C_MDS_SlaveRenameCommit : public ServerContext { public: C_MDS_SlaveRenameCommit(Server *s, MDRequestRef& m, CDentry *sr, CDentry *de, CDentry *st) : ServerContext(s), mdr(m), srcdn(sr), destdn(de), straydn(st) {} - void finish(int r) { + void finish(int r) override { server->_commit_slave_rename(mdr, r, srcdn, destdn, straydn); } }; @@ -7171,7 +7171,7 @@ class C_MDS_SlaveRenameSessionsFlushed : public ServerContext { public: C_MDS_SlaveRenameSessionsFlushed(Server *s, MDRequestRef& r) : ServerContext(s), mdr(r) {} - void finish(int r) { + void finish(int r) override { server->_slave_rename_sessions_flushed(mdr); } }; @@ -7600,7 +7600,7 @@ struct C_MDS_LoggedRenameRollback : public ServerLogContext { CDentry *st, bool f) : ServerLogContext(s, r), mut(m), srcdn(sd), srcdnpv(pv), destdn(dd), straydn(st), finish_mdr(f) {} - void finish(int r) { + void finish(int r) override { server->_rename_rollback_finish(mut, mdr, srcdn, srcdnpv, destdn, straydn, finish_mdr); } @@ -8090,7 +8090,7 @@ struct C_MDS_mksnap_finish : public ServerLogContext { SnapInfo info; C_MDS_mksnap_finish(Server *s, MDRequestRef& r, CInode *di, SnapInfo &i) : ServerLogContext(s, r), diri(di), info(i) {} - void finish(int r) { + void finish(int r) override { server->_mksnap_finish(mdr, diri, info); } }; @@ -8242,7 +8242,7 @@ struct C_MDS_rmsnap_finish : public ServerLogContext { snapid_t snapid; C_MDS_rmsnap_finish(Server *s, MDRequestRef& r, CInode *di, snapid_t sn) : ServerLogContext(s, r), diri(di), snapid(sn) {} - void finish(int r) { + void finish(int r) override { server->_rmsnap_finish(mdr, diri, snapid); } }; @@ -8368,7 +8368,7 @@ struct C_MDS_renamesnap_finish : public ServerLogContext { snapid_t snapid; C_MDS_renamesnap_finish(Server *s, MDRequestRef& r, CInode *di, snapid_t sn) : ServerLogContext(s, r), diri(di), snapid(sn) {} - void finish(int r) { + void finish(int r) override { server->_renamesnap_finish(mdr, diri, snapid); } }; diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index f70337fd67e06..a32437de2c1f6 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -34,7 +34,7 @@ class SessionMapIOContext : public MDSIOContextBase { protected: SessionMap *sessionmap; - MDSRank *get_mds() {return sessionmap->mds;} + MDSRank *get_mds() override {return sessionmap->mds;} public: explicit SessionMapIOContext(SessionMap *sessionmap_) : sessionmap(sessionmap_) { assert(sessionmap != NULL); @@ -94,7 +94,7 @@ class C_IO_SM_Load : public SessionMapIOContext { C_IO_SM_Load(SessionMap *cm, const bool f) : SessionMapIOContext(cm), first(f), header_r(0), values_r(0) {} - void finish(int r) { + void finish(int r) override { sessionmap->_load_finish(r, header_r, values_r, first, header_bl, session_vals); } }; @@ -275,7 +275,7 @@ class C_IO_SM_LoadLegacy : public SessionMapIOContext { public: bufferlist bl; explicit C_IO_SM_LoadLegacy(SessionMap *cm) : SessionMapIOContext(cm) {} - void finish(int r) { + void finish(int r) override { sessionmap->_load_legacy_finish(r, bl); } }; @@ -338,7 +338,7 @@ class C_IO_SM_Save : public SessionMapIOContext { version_t version; public: C_IO_SM_Save(SessionMap *cm, version_t v) : SessionMapIOContext(cm), version(v) {} - void finish(int r) { + void finish(int r) override { assert(r == 0); sessionmap->_save_finish(version); } @@ -675,7 +675,7 @@ class C_IO_SM_Save_One : public SessionMapIOContext { public: C_IO_SM_Save_One(SessionMap *cm, MDSInternalContextBase *on_safe_) : SessionMapIOContext(cm), on_safe(on_safe_) {} - void finish(int r) { + void finish(int r) override { if (r != 0) { get_mds()->handle_write_error(r); } else { diff --git a/src/mds/SnapRealm.cc b/src/mds/SnapRealm.cc index 3f9b93d3a2b35..0b22b14b694c9 100644 --- a/src/mds/SnapRealm.cc +++ b/src/mds/SnapRealm.cc @@ -100,8 +100,8 @@ struct C_SR_RetryOpenParents : public MDSInternalContextBase { sr(s), first(f), last(l), parent_last(pl), parent(p), fin(c) { sr->inode->get(CInode::PIN_OPENINGSNAPPARENTS); } - MDSRank *get_mds() { return sr->mdcache->mds; } - void finish(int r) { + MDSRank *get_mds() override { return sr->mdcache->mds; } + void finish(int r) override { if (r < 0) sr->_remove_missing_parent(parent_last, parent, r); if (sr->_open_parents(fin, first, last)) diff --git a/src/mds/StrayManager.cc b/src/mds/StrayManager.cc index f62c73dab4917..e914790cc05d3 100644 --- a/src/mds/StrayManager.cc +++ b/src/mds/StrayManager.cc @@ -38,7 +38,7 @@ static ostream& _prefix(std::ostream *_dout, MDSRank *mds) { class StrayManagerIOContext : public virtual MDSIOContextBase { protected: StrayManager *sm; - virtual MDSRank *get_mds() + MDSRank *get_mds() override { return sm->mds; } @@ -49,7 +49,7 @@ class StrayManagerIOContext : public virtual MDSIOContextBase { class StrayManagerLogContext : public virtual MDSLogContextBase { protected: StrayManager *sm; - virtual MDSRank *get_mds() + MDSRank *get_mds() override { return sm->mds; } @@ -60,7 +60,7 @@ class StrayManagerLogContext : public virtual MDSLogContextBase { class StrayManagerContext : public virtual MDSInternalContextBase { protected: StrayManager *sm; - virtual MDSRank *get_mds() + MDSRank *get_mds() override { return sm->mds; } @@ -80,7 +80,7 @@ class C_IO_PurgeStrayPurged : public StrayManagerIOContext { public: C_IO_PurgeStrayPurged(StrayManager *sm_, CDentry *d, bool oh, uint32_t ops) : StrayManagerIOContext(sm_), dn(d), only_head(oh), ops_allowance(ops) { } - void finish(int r) { + void finish(int r) override { assert(r == 0 || r == -ENOENT); sm->_purge_stray_purged(dn, ops_allowance, only_head); } @@ -188,7 +188,7 @@ class C_PurgeStrayLogged : public StrayManagerLogContext { public: C_PurgeStrayLogged(StrayManager *sm_, CDentry *d, version_t v, LogSegment *s) : StrayManagerLogContext(sm_), dn(d), pdv(v), ls(s) { } - void finish(int r) { + void finish(int r) override { sm->_purge_stray_logged(dn, pdv, ls); } }; @@ -199,7 +199,7 @@ class C_TruncateStrayLogged : public StrayManagerLogContext { public: C_TruncateStrayLogged(StrayManager *sm, CDentry *d, LogSegment *s) : StrayManagerLogContext(sm), dn(d), ls(s) { } - void finish(int r) { + void finish(int r) override { sm->_truncate_stray_logged(dn, ls); } }; @@ -365,7 +365,7 @@ class C_StraysFetched : public StrayManagerContext { public: C_StraysFetched(StrayManager *sm_) : StrayManagerContext(sm_) { } - void finish(int r) { + void finish(int r) override { sm->_advance(); } }; @@ -486,7 +486,7 @@ class C_OpenSnapParents : public StrayManagerContext { public: C_OpenSnapParents(StrayManager *sm_, CDentry *dn_, bool t, uint32_t ops) : StrayManagerContext(sm_), dn(dn_), trunc(t), ops_required(ops) { } - void finish(int r) { + void finish(int r) override { sm->_process(dn, trunc, ops_required); } }; @@ -586,7 +586,7 @@ void StrayManager::notify_stray_removed() struct C_EvalStray : public StrayManagerContext { CDentry *dn; C_EvalStray(StrayManager *sm_, CDentry *d) : StrayManagerContext(sm_), dn(d) {} - void finish(int r) { + void finish(int r) override { sm->eval_stray(dn); } }; @@ -594,7 +594,7 @@ struct C_EvalStray : public StrayManagerContext { struct C_MDC_EvalStray : public StrayManagerContext { CDentry *dn; C_MDC_EvalStray(StrayManager *sm_, CDentry *d) : StrayManagerContext(sm_), dn(d) {} - void finish(int r) { + void finish(int r) override { sm->eval_stray(dn); } };