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

common: add override in header file #13774

Merged
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/ceph_fuse.cc
Expand Up @@ -153,7 +153,7 @@ int main(int argc, const char **argv, const char *envp[]) {
cfuse = cf;
client = cl;
}
~RemountTest() {}
~RemountTest() override {}
void *entry() override {
#if defined(__linux__)
int ver = get_linux_version();
Expand Down
26 changes: 13 additions & 13 deletions src/client/Client.h
Expand Up @@ -259,7 +259,7 @@ class Client : public Dispatcher, public md_config_obs_t {
public:
explicit CommandHook(Client *client);
bool call(std::string command, cmdmap_t &cmdmap, std::string format,
bufferlist& out);
bufferlist& out) override;
};
CommandHook m_command_hook;

Expand Down Expand Up @@ -554,13 +554,13 @@ class Client : public Dispatcher, public md_config_obs_t {

// friends
friend class SyntheticClient;
bool ms_dispatch(Message *m);
bool ms_dispatch(Message *m) override;

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);
bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new);
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) override;

int authenticate();

Expand Down Expand Up @@ -591,7 +591,7 @@ class Client : public Dispatcher, public md_config_obs_t {
void clear_filer_flags(int flags);

Client(Messenger *m, MonClient *mc);
~Client();
~Client() override;
void tear_down_cache();

void update_metadata(std::string const &k, std::string const &v);
Expand Down Expand Up @@ -751,8 +751,8 @@ class Client : public Dispatcher, public md_config_obs_t {
Client *client;
Fh *f;
C_Readahead(Client *c, Fh *f);
~C_Readahead();
void finish(int r);
~C_Readahead() override;
void finish(int r) override;
};

int _read_sync(Fh *f, uint64_t off, uint64_t len, bufferlist *bl, bool *checkeof);
Expand Down Expand Up @@ -1219,9 +1219,9 @@ class Client : public Dispatcher, public md_config_obs_t {
void ll_register_callbacks(struct client_callback_args *args);
int test_dentry_handling(bool can_invalidate);

virtual const char** get_tracked_conf_keys() const;
virtual void handle_conf_change(const struct md_config_t *conf,
const std::set <std::string> &changed);
const char** get_tracked_conf_keys() const override;
void handle_conf_change(const struct md_config_t *conf,
const std::set <std::string> &changed) override;
};

#endif
20 changes: 10 additions & 10 deletions src/client/ObjecterWriteback.h
Expand Up @@ -12,43 +12,43 @@ class ObjecterWriteback : public WritebackHandler {
: m_objecter(o),
m_finisher(fin),
m_lock(lock) { }
virtual ~ObjecterWriteback() {}
~ObjecterWriteback() override {}

virtual void read(const object_t& oid, uint64_t object_no,
void read(const object_t& oid, uint64_t object_no,
const object_locator_t& oloc, uint64_t off, uint64_t len,
snapid_t snapid, bufferlist *pbl, uint64_t trunc_size,
__u32 trunc_seq, int op_flags, Context *onfinish) {
__u32 trunc_seq, int op_flags, Context *onfinish) override {
m_objecter->read_trunc(oid, oloc, off, len, snapid, pbl, 0,
trunc_size, trunc_seq,
new C_OnFinisher(new C_Lock(m_lock, onfinish),
m_finisher));
}

virtual bool may_copy_on_write(const object_t& oid, uint64_t read_off,
uint64_t read_len, snapid_t snapid) {
bool may_copy_on_write(const object_t& oid, uint64_t read_off,
uint64_t read_len, snapid_t snapid) override {
return false;
}

virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
uint64_t off, uint64_t len,
const SnapContext& snapc, const bufferlist &bl,
ceph::real_time mtime, uint64_t trunc_size,
__u32 trunc_seq, ceph_tid_t journal_tid,
Context *oncommit) {
Context *oncommit) override {
return m_objecter->write_trunc(oid, oloc, off, len, snapc, bl, mtime, 0,
trunc_size, trunc_seq,
new C_OnFinisher(new C_Lock(m_lock,
oncommit),
m_finisher));
}

virtual bool can_scattered_write() { return true; }
bool can_scattered_write() override { return true; }
using WritebackHandler::write;
virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
vector<pair<uint64_t, bufferlist> >& io_vec,
const SnapContext& snapc, ceph::real_time mtime,
uint64_t trunc_size, __u32 trunc_seq,
Context *oncommit) {
Context *oncommit) override {
ObjectOperation op;
for (vector<pair<uint64_t, bufferlist> >::iterator p = io_vec.begin();
p != io_vec.end();
Expand Down
2 changes: 1 addition & 1 deletion src/cls/cephfs/cls_cephfs.cc
Expand Up @@ -145,7 +145,7 @@ class PGLSCephFSFilter : public PGLSFilter {
return 0;
}

~PGLSCephFSFilter() {}
~PGLSCephFSFilter() override {}
bool reject_empty_xattr() override { return false; }
bool filter(const hobject_t &obj, bufferlist& xattr_data,
bufferlist& outdata) override;
Expand Down
2 changes: 1 addition & 1 deletion src/cls/hello/cls_hello.cc
Expand Up @@ -262,7 +262,7 @@ class PGLSHelloFilter : public PGLSFilter {
return 0;
}

~PGLSHelloFilter() {}
~PGLSHelloFilter() override {}
bool filter(const hobject_t &obj, bufferlist& xattr_data,
bufferlist& outdata) override
{
Expand Down
4 changes: 2 additions & 2 deletions src/cls/rgw/cls_rgw_client.cc
Expand Up @@ -24,7 +24,7 @@ class ClsBucketIndexOpCtx : public ObjectOperationCompletion {
int *ret_code;
public:
ClsBucketIndexOpCtx(T* _data, int *_ret_code) : data(_data), ret_code(_ret_code) { assert(data); }
~ClsBucketIndexOpCtx() {}
~ClsBucketIndexOpCtx() override {}
void handle_completion(int r, bufferlist& outbl) override {
if (r >= 0) {
try {
Expand Down Expand Up @@ -520,7 +520,7 @@ class GetDirHeaderCompletion : public ObjectOperationCompletion {
RGWGetDirHeader_CB *ret_ctx;
public:
explicit GetDirHeaderCompletion(RGWGetDirHeader_CB *_ctx) : ret_ctx(_ctx) {}
~GetDirHeaderCompletion() {
~GetDirHeaderCompletion() override {
ret_ctx->put();
}
void handle_completion(int r, bufferlist& outbl) override {
Expand Down
30 changes: 15 additions & 15 deletions src/cls/rgw/cls_rgw_client.h
Expand Up @@ -122,7 +122,7 @@ class BucketIndexAioManager {

class RGWGetDirHeader_CB : public RefCountedObject {
public:
virtual ~RGWGetDirHeader_CB() {}
~RGWGetDirHeader_CB() override {}
virtual void handle_response(int r, rgw_bucket_dir_header& header) = 0;
};

Expand Down Expand Up @@ -285,9 +285,9 @@ class CLSRGWConcurrentIO {

class CLSRGWIssueBucketIndexInit : public CLSRGWConcurrentIO {
protected:
int issue_op(int shard_id, const string& oid);
int valid_ret_code() { return -EEXIST; }
void cleanup();
int issue_op(int shard_id, const string& oid) override;
int valid_ret_code() override { return -EEXIST; }
void cleanup() override;
public:
CLSRGWIssueBucketIndexInit(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
uint32_t _max_aio) :
Expand All @@ -297,7 +297,7 @@ class CLSRGWIssueBucketIndexInit : public CLSRGWConcurrentIO {
class CLSRGWIssueSetTagTimeout : public CLSRGWConcurrentIO {
uint64_t tag_timeout;
protected:
int issue_op(int shard_id, const string& oid);
int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueSetTagTimeout(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
uint32_t _max_aio, uint64_t _tag_timeout) :
Expand Down Expand Up @@ -368,7 +368,7 @@ class CLSRGWIssueBucketList : public CLSRGWConcurrentIO {
bool list_versions;
map<int, rgw_cls_list_ret>& result;
protected:
int issue_op(int shard_id, const string& oid);
int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueBucketList(librados::IoCtx& io_ctx, const cls_rgw_obj_key& _start_obj,
const string& _filter_prefix, uint32_t _num_entries,
Expand All @@ -385,7 +385,7 @@ class CLSRGWIssueBILogList : public CLSRGWConcurrentIO {
BucketIndexShardsManager& marker_mgr;
uint32_t max;
protected:
int issue_op(int shard_id, const string& oid);
int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueBILogList(librados::IoCtx& io_ctx, BucketIndexShardsManager& _marker_mgr, uint32_t _max,
map<int, string>& oids,
Expand All @@ -398,12 +398,12 @@ class CLSRGWIssueBILogTrim : public CLSRGWConcurrentIO {
BucketIndexShardsManager& start_marker_mgr;
BucketIndexShardsManager& end_marker_mgr;
protected:
int issue_op(int shard_id, const string& oid);
int issue_op(int shard_id, const string& oid) override;
// Trim until -ENODATA is returned.
int valid_ret_code() { return -ENODATA; }
bool need_multiple_rounds() { return true; }
void add_object(int shard, const string& oid) { objs_container[shard] = oid; }
void reset_container(map<int, string>& objs) {
int valid_ret_code() override { return -ENODATA; }
bool need_multiple_rounds() override { return true; }
void add_object(int shard, const string& oid) override { objs_container[shard] = oid; }
void reset_container(map<int, string>& objs) override {
objs_container.swap(objs);
iter = objs_container.begin();
objs.clear();
Expand All @@ -427,7 +427,7 @@ class CLSRGWIssueBILogTrim : public CLSRGWConcurrentIO {
class CLSRGWIssueBucketCheck : public CLSRGWConcurrentIO /*<map<string, struct rgw_cls_check_index_ret> >*/ {
map<int, struct rgw_cls_check_index_ret>& result;
protected:
int issue_op(int shard_id, const string& oid);
int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueBucketCheck(librados::IoCtx& ioc, map<int, string>& oids, map<int, struct rgw_cls_check_index_ret>& bucket_objs_ret,
uint32_t _max_aio) :
Expand All @@ -436,7 +436,7 @@ class CLSRGWIssueBucketCheck : public CLSRGWConcurrentIO /*<map<string, struct r

class CLSRGWIssueBucketRebuild : public CLSRGWConcurrentIO {
protected:
int issue_op(int shard_id, const string& oid);
int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueBucketRebuild(librados::IoCtx& io_ctx, map<int, string>& bucket_objs,
uint32_t max_aio) : CLSRGWConcurrentIO(io_ctx, bucket_objs, max_aio) {}
Expand All @@ -445,7 +445,7 @@ class CLSRGWIssueBucketRebuild : public CLSRGWConcurrentIO {
class CLSRGWIssueGetDirHeader : public CLSRGWConcurrentIO {
map<int, rgw_cls_list_ret>& result;
protected:
int issue_op(int shard_id, const string& oid);
int issue_op(int shard_id, const string& oid) override;
public:
CLSRGWIssueGetDirHeader(librados::IoCtx& io_ctx, map<int, string>& oids, map<int, rgw_cls_list_ret>& dir_headers,
uint32_t max_aio) :
Expand Down
2 changes: 1 addition & 1 deletion src/cls/user/cls_user_client.cc
Expand Up @@ -97,7 +97,7 @@ class ClsUserGetHeaderCtx : public ObjectOperationCompletion {
int *pret;
public:
ClsUserGetHeaderCtx(cls_user_header *_h, RGWGetUserHeader_CB *_ctx, int *_pret) : header(_h), ret_ctx(_ctx), pret(_pret) {}
~ClsUserGetHeaderCtx() {
~ClsUserGetHeaderCtx() override {
if (ret_ctx) {
ret_ctx->put();
}
Expand Down
2 changes: 1 addition & 1 deletion src/cls/user/cls_user_client.h
Expand Up @@ -11,7 +11,7 @@

class RGWGetUserHeader_CB : public RefCountedObject {
public:
virtual ~RGWGetUserHeader_CB() {}
~RGWGetUserHeader_CB() override {}
virtual void handle_response(int r, cls_user_header& header) = 0;
};

Expand Down
8 changes: 4 additions & 4 deletions src/common/Cond.h
Expand Up @@ -139,7 +139,7 @@ class C_Cond : public Context {
C_Cond(Cond *c, bool *d, int *r) : cond(c), done(d), rval(r) {
*done = false;
}
void finish(int r) {
void finish(int r) override {
*done = true;
*rval = r;
cond->Signal();
Expand All @@ -162,7 +162,7 @@ class C_SafeCond : public Context {
C_SafeCond(Mutex *l, Cond *c, bool *d, int *r=0) : lock(l), cond(c), done(d), rval(r) {
*done = false;
}
void finish(int r) {
void finish(int r) override {
lock->Lock();
if (rval)
*rval = r;
Expand All @@ -185,10 +185,10 @@ class C_SaferCond : public Context {
int rval; ///< return value
public:
C_SaferCond() : lock("C_SaferCond"), done(false), rval(0) {}
void finish(int r) { complete(r); }
void finish(int r) override { complete(r); }

/// We overload complete in order to not delete the context
void complete(int r) {
void complete(int r) override {
Mutex::Locker l(lock);
done = true;
rval = r;
Expand Down
2 changes: 1 addition & 1 deletion src/common/ContextCompletion.h
Expand Up @@ -34,7 +34,7 @@ class C_ContextCompletion : public Context {
m_context_completion.start_op();
}

virtual void finish(int r) {
void finish(int r) override {
m_context_completion.finish_op(r);
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/Continuation.h
Expand Up @@ -58,7 +58,7 @@ class Continuation {
Callback(Continuation *c, int stage) :
continuation(c),
stage_to_activate(stage) {}
void finish(int r) {
void finish(int r) override {
continuation->continue_function(r, stage_to_activate);
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/common/Finisher.h
Expand Up @@ -63,7 +63,7 @@ class Finisher {
struct FinisherThread : public Thread {
Finisher *fin;
explicit FinisherThread(Finisher *f) : fin(f) {}
void* entry() { return (void*)fin->finisher_thread_entry(); }
void* entry() override { return (void*)fin->finisher_thread_entry(); }
} finisher_thread;

public:
Expand Down Expand Up @@ -174,14 +174,14 @@ class C_OnFinisher : public Context {
assert(con != NULL);
}

~C_OnFinisher() {
~C_OnFinisher() override {
if (con != nullptr) {
delete con;
con = nullptr;
}
}

void finish(int r) {
void finish(int r) override {
fin->queue(con, r);
con = nullptr;
}
Expand Down