Skip to content

Commit

Permalink
common: add override for common submodule and misc
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/18922

Signed-off-by: liuchang0812 <[email protected]>
  • Loading branch information
liuchang0812 committed Feb 16, 2017
1 parent 05f1a19 commit da109b3
Show file tree
Hide file tree
Showing 85 changed files with 382 additions and 382 deletions.
24 changes: 12 additions & 12 deletions src/auth/Crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ uint64_t get_random(uint64_t min_val, uint64_t max_val)
class CryptoNoneKeyHandler : public CryptoKeyHandler {
public:
int encrypt(const bufferlist& in,
bufferlist& out, std::string *error) const {
bufferlist& out, std::string *error) const override {
out = in;
return 0;
}
int decrypt(const bufferlist& in,
bufferlist& out, std::string *error) const {
bufferlist& out, std::string *error) const override {
out = in;
return 0;
}
Expand All @@ -82,16 +82,16 @@ class CryptoNone : public CryptoHandler {
public:
CryptoNone() { }
~CryptoNone() {}
int get_type() const {
int get_type() const override {
return CEPH_CRYPTO_NONE;
}
int create(bufferptr& secret) {
int create(bufferptr& secret) override {
return 0;
}
int validate_secret(const bufferptr& secret) {
int validate_secret(const bufferptr& secret) override {
return 0;
}
CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) {
CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) override {
return new CryptoNoneKeyHandler;
}
};
Expand All @@ -104,12 +104,12 @@ class CryptoAES : public CryptoHandler {
public:
CryptoAES() { }
~CryptoAES() {}
int get_type() const {
int get_type() const override {
return CEPH_CRYPTO_AES;
}
int create(bufferptr& secret);
int validate_secret(const bufferptr& secret);
CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error);
int create(bufferptr& secret) override;
int validate_secret(const bufferptr& secret) override;
CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) override;
};

#ifdef USE_CRYPTOPP
Expand Down Expand Up @@ -312,11 +312,11 @@ class CryptoAESKeyHandler : public CryptoKeyHandler {
}

int encrypt(const bufferlist& in,
bufferlist& out, std::string *error) const {
bufferlist& out, std::string *error) const override {
return nss_aes_operation(CKA_ENCRYPT, mechanism, key, param, in, out, error);
}
int decrypt(const bufferlist& in,
bufferlist& out, std::string *error) const {
bufferlist& out, std::string *error) const override {
return nss_aes_operation(CKA_DECRYPT, mechanism, key, param, in, out, error);
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/ceph_fuse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ int main(int argc, const char **argv, const char *envp[]) {
cfuse = cf;
client = cl;
}
virtual ~RemountTest() {}
virtual void *entry() {
~RemountTest() {}
void *entry() override {
#if defined(__linux__)
int ver = get_linux_version();
assert(ver != 0);
Expand Down
12 changes: 6 additions & 6 deletions src/client/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@ class C_Client_FlushComplete : public Context {
InodeRef inode;
public:
C_Client_FlushComplete(Client *c, Inode *in) : client(c), inode(in) { }
void finish(int r) {
void finish(int r) override {
assert(client->client_lock.is_locked_by_me());
if (r != 0) {
client_t const whoami = client->whoami; // For the benefit of ldout prefix
Expand Down Expand Up @@ -3633,7 +3633,7 @@ class C_Client_CacheInvalidate : public Context {
else
ino = in->vino();
}
void finish(int r) {
void finish(int r) override {
// _async_invalidate takes the lock when it needs to, call this back from outside of lock.
assert(!client->client_lock.is_locked_by_me());
client->_async_invalidate(ino, offset, length);
Expand Down Expand Up @@ -3940,7 +3940,7 @@ class C_Client_Remount : public Context {
Client *client;
public:
explicit C_Client_Remount(Client *c) : client(c) {}
void finish(int r) {
void finish(int r) override {
assert (r == 0);
r = client->remount_cb(client->callback_handle);
if (r != 0) {
Expand Down Expand Up @@ -4835,7 +4835,7 @@ class C_Client_DentryInvalidate : public Context {
if (!del)
ino.ino = inodeno_t();
}
void finish(int r) {
void finish(int r) override {
// _async_dentry_invalidate is responsible for its own locking
assert(!client->client_lock.is_locked_by_me());
client->_async_dentry_invalidate(dirino, ino, name);
Expand Down Expand Up @@ -5812,7 +5812,7 @@ class C_C_Tick : public Context {
Client *client;
public:
explicit C_C_Tick(Client *c) : client(c) {}
void finish(int r) {
void finish(int r) override {
// Called back via Timer, which takes client_lock for us
assert(client->client_lock.is_locked_by_me());
client->tick();
Expand Down Expand Up @@ -12441,7 +12441,7 @@ class C_Client_RequestInterrupt : public Context {
C_Client_RequestInterrupt(Client *c, MetaRequest *r) : client(c), req(r) {
req->get();
}
void finish(int r) {
void finish(int r) override {
Mutex::Locker l(client->client_lock);
assert(req->head.op == CEPH_MDS_OP_SETFILELOCK);
client->_interrupt_filelock(req);
Expand Down
2 changes: 1 addition & 1 deletion src/client/SyntheticClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,7 @@ class C_Ref : public Context {
(*ref)++;
lock.Unlock();
}
void finish(int) {
void finish(int) override {
lock.Lock();
(*ref)--;
cond.Signal();
Expand Down
10 changes: 5 additions & 5 deletions src/cls/cephfs/cls_cephfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class PGLSCephFSFilter : public PGLSFilter {
protected:
std::string scrub_tag;
public:
int init(bufferlist::iterator& params) {
int init(bufferlist::iterator& params) override {
try {
InodeTagFilterArgs args;
args.decode(params);
Expand All @@ -145,10 +145,10 @@ class PGLSCephFSFilter : public PGLSFilter {
return 0;
}

virtual ~PGLSCephFSFilter() {}
virtual bool reject_empty_xattr() { return false; }
virtual bool filter(const hobject_t &obj, bufferlist& xattr_data,
bufferlist& outdata);
~PGLSCephFSFilter() {}
bool reject_empty_xattr() override { return false; }
bool filter(const hobject_t &obj, bufferlist& xattr_data,
bufferlist& outdata) override;
};

bool PGLSCephFSFilter::filter(const hobject_t &obj,
Expand Down
8 changes: 4 additions & 4 deletions src/cls/hello/cls_hello.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static int bad_writer(cls_method_context_t hctx, bufferlist *in, bufferlist *out
class PGLSHelloFilter : public PGLSFilter {
string val;
public:
int init(bufferlist::iterator& params) {
int init(bufferlist::iterator& params) override {
try {
::decode(xattr, params);
::decode(val, params);
Expand All @@ -262,9 +262,9 @@ class PGLSHelloFilter : public PGLSFilter {
return 0;
}

virtual ~PGLSHelloFilter() {}
virtual bool filter(const hobject_t &obj, bufferlist& xattr_data,
bufferlist& outdata)
~PGLSHelloFilter() {}
bool filter(const hobject_t &obj, bufferlist& xattr_data,
bufferlist& outdata) override
{
if (val.size() != xattr_data.length())
return false;
Expand Down
8 changes: 4 additions & 4 deletions src/cls/journal/cls_journal_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct C_ClientList : public C_AioExec {
rados_completion->release();
}

virtual void complete(int r) {
void complete(int r) override {
if (r < 0) {
finish(r);
return;
Expand All @@ -81,7 +81,7 @@ struct C_ClientList : public C_AioExec {
}
}

virtual void finish(int r) {
void finish(int r) override {
on_finish->complete(r);
delete this;
}
Expand Down Expand Up @@ -115,7 +115,7 @@ struct C_ImmutableMetadata : public C_AioExec {
rados_completion->release();
}

virtual void finish(int r) {
void finish(int r) override {
if (r == 0) {
try {
bufferlist::iterator iter = outbl.begin();
Expand Down Expand Up @@ -155,7 +155,7 @@ struct C_MutableMetadata : public C_AioExec {
rados_completion->release();
}

virtual void finish(int r) {
void finish(int r) override {
if (r == 0) {
try {
bufferlist::iterator iter = outbl.begin();
Expand Down
4 changes: 2 additions & 2 deletions src/cls/log/cls_log_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class LogListCtx : public ObjectOperationCompletion {
public:
LogListCtx(list<cls_log_entry> *_entries, string *_marker, bool *_truncated) :
entries(_entries), marker(_marker), truncated(_truncated) {}
void handle_completion(int r, bufferlist& outbl) {
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_log_list_ret ret;
try {
Expand Down Expand Up @@ -128,7 +128,7 @@ class LogInfoCtx : public ObjectOperationCompletion {
cls_log_header *header;
public:
explicit LogInfoCtx(cls_log_header *_header) : header(_header) {}
void handle_completion(int r, bufferlist& outbl) {
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_log_info_ret ret;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/cls/statelog/cls_statelog_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class StateLogListCtx : public ObjectOperationCompletion {
public:
StateLogListCtx(list<cls_statelog_entry> *_entries, string *_marker, bool *_truncated) :
entries(_entries), marker(_marker), truncated(_truncated) {}
void handle_completion(int r, bufferlist& outbl) {
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_statelog_list_ret ret;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/cls/timeindex/cls_timeindex_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class TimeindexListCtx : public ObjectOperationCompletion {
bool *_truncated)
: entries(_entries), marker(_marker), truncated(_truncated) {}

void handle_completion(int r, bufferlist& outbl) {
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_timeindex_list_ret ret;
try {
Expand Down
4 changes: 2 additions & 2 deletions src/cls/user/cls_user_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ClsUserListCtx : public ObjectOperationCompletion {
public:
ClsUserListCtx(list<cls_user_bucket_entry> *_entries, string *_marker, bool *_truncated, int *_pret) :
entries(_entries), marker(_marker), truncated(_truncated), pret(_pret) {}
void handle_completion(int r, bufferlist& outbl) {
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_user_list_buckets_ret ret;
try {
Expand Down Expand Up @@ -102,7 +102,7 @@ class ClsUserGetHeaderCtx : public ObjectOperationCompletion {
ret_ctx->put();
}
}
void handle_completion(int r, bufferlist& outbl) {
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_user_get_header_ret ret;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/cls/version/cls_version_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class VersionReadCtx : public ObjectOperationCompletion {
obj_version *objv;
public:
explicit VersionReadCtx(obj_version *_objv) : objv(_objv) {}
void handle_completion(int r, bufferlist& outbl) {
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
cls_version_read_ret ret;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/common/Timer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SafeTimerThread : public Thread {
SafeTimer *parent;
public:
explicit SafeTimerThread(SafeTimer *s) : parent(s) {}
void *entry() {
void *entry() override {
parent->timer_thread();
return NULL;
}
Expand Down
8 changes: 4 additions & 4 deletions src/common/admin_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ int AdminSocket::unregister_command(std::string command)

class VersionHook : public AdminSocketHook {
public:
virtual bool call(std::string command, cmdmap_t &cmdmap, std::string format,
bufferlist& out) {
bool call(std::string command, cmdmap_t &cmdmap, std::string format,
bufferlist& out) override {
if (command == "0") {
out.append(CEPH_ADMIN_SOCK_VERSION);
} else {
Expand All @@ -512,7 +512,7 @@ class HelpHook : public AdminSocketHook {
AdminSocket *m_as;
public:
explicit HelpHook(AdminSocket *as) : m_as(as) {}
bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) {
bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) override {
Formatter *f = Formatter::create(format, "json-pretty", "json-pretty");
f->open_object_section("help");
for (map<string,string>::iterator p = m_as->m_help.begin();
Expand All @@ -534,7 +534,7 @@ class GetdescsHook : public AdminSocketHook {
AdminSocket *m_as;
public:
explicit GetdescsHook(AdminSocket *as) : m_as(as) {}
bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) {
bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) override {
int cmdnum = 0;
JSONFormatter jf(false);
jf.open_object_section("command_descriptions");
Expand Down
Loading

0 comments on commit da109b3

Please sign in to comment.