Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

mds: add override in mds subsystem #13438

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mds/Beacon.cc
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions src/mds/CDir.cc
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
};
Expand Down Expand Up @@ -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());
}
};
Expand Down
14 changes: 7 additions & 7 deletions src/mds/CInode.cc
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
};
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
};
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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))
Expand Down
12 changes: 6 additions & 6 deletions src/mds/DamageTable.cc
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down
20 changes: 10 additions & 10 deletions src/mds/Locker.cc
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
};
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
};
Expand Down Expand Up @@ -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);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/mds/MDBalancer.cc
Expand Up @@ -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();
}
};
Expand Down