From f72b8812494ed58134fea8dbb0a62e33f24023a8 Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Mon, 20 Feb 2017 22:23:47 +0800 Subject: [PATCH] librbd: add override in header files Fixes: http://tracker.ceph.com/issues/19012 Signed-off-by: liuchang0812 --- src/librbd/AsyncObjectThrottle.h | 4 +- src/librbd/ExclusiveLock.h | 14 ++-- src/librbd/ImageWatcher.h | 20 ++--- src/librbd/Journal.h | 16 ++-- src/librbd/LibrbdAdminSocketHook.h | 4 +- src/librbd/LibrbdWriteback.h | 32 ++++---- src/librbd/ManagedLock.h | 2 +- src/librbd/MirroringWatcher.h | 4 +- src/librbd/TaskFinisher.h | 2 +- src/librbd/Utils.h | 8 +- src/librbd/Watcher.h | 12 +-- src/librbd/cache/PassthroughImageCache.h | 22 +++--- src/librbd/exclusive_lock/AutomaticPolicy.h | 4 +- src/librbd/exclusive_lock/StandardPolicy.h | 4 +- src/librbd/internal.h | 2 +- src/librbd/io/AioCompletion.h | 4 +- src/librbd/io/ImageRequest.h | 76 ++++++++++--------- src/librbd/io/ImageRequestWQ.h | 8 +- src/librbd/io/ObjectRequest.h | 64 ++++++++-------- src/librbd/journal/DisabledPolicy.h | 6 +- src/librbd/journal/Replay.h | 6 +- src/librbd/journal/StandardPolicy.h | 6 +- src/librbd/journal/Utils.h | 8 +- src/librbd/object_map/InvalidateRequest.h | 6 +- src/librbd/object_map/Request.h | 6 +- src/librbd/object_map/ResizeRequest.h | 4 +- src/librbd/object_map/SnapshotCreateRequest.h | 4 +- src/librbd/object_map/SnapshotRemoveRequest.h | 6 +- .../object_map/SnapshotRollbackRequest.h | 4 +- src/librbd/object_map/UpdateRequest.h | 4 +- src/librbd/operation/DisableFeaturesRequest.h | 8 +- src/librbd/operation/EnableFeaturesRequest.h | 8 +- src/librbd/operation/FlattenRequest.h | 6 +- src/librbd/operation/MetadataRemoveRequest.h | 6 +- src/librbd/operation/MetadataSetRequest.h | 6 +- src/librbd/operation/ObjectMapIterate.h | 4 +- .../operation/RebuildObjectMapRequest.h | 4 +- src/librbd/operation/RenameRequest.h | 6 +- src/librbd/operation/Request.h | 10 +-- src/librbd/operation/ResizeRequest.h | 12 +-- src/librbd/operation/SnapshotCreateRequest.h | 8 +- src/librbd/operation/SnapshotLimitRequest.h | 6 +- src/librbd/operation/SnapshotProtectRequest.h | 6 +- src/librbd/operation/SnapshotRemoveRequest.h | 6 +- src/librbd/operation/SnapshotRenameRequest.h | 6 +- .../operation/SnapshotRollbackRequest.h | 8 +- .../operation/SnapshotUnprotectRequest.h | 8 +- src/librbd/operation/TrimRequest.h | 4 +- src/librbd/watcher/Notifier.h | 2 +- src/librbd/watcher/Types.h | 2 +- src/rbd_replay/Replayer.hpp | 22 +++--- src/rbd_replay/actions.hpp | 58 +++++++------- src/rbd_replay/ios.hpp | 48 ++++++------ src/test/librbd/io/test_mock_ImageRequest.cc | 4 +- src/test/librbd/test_fixture.h | 4 +- src/test/librbd/test_mock_fixture.h | 4 +- src/test/rbd_mirror/test_ClusterWatcher.cc | 2 +- src/test/rbd_mirror/test_PoolWatcher.cc | 2 +- src/test/rbd_mirror/test_fixture.h | 4 +- src/test/rbd_mirror/test_mock_fixture.h | 4 +- src/tools/rbd/IndentStream.h | 2 +- src/tools/rbd/Utils.h | 2 +- src/tools/rbd_mirror/ImageDeleter.h | 2 +- src/tools/rbd_mirror/ImageReplayer.h | 14 ++-- src/tools/rbd_mirror/ImageSync.h | 6 +- src/tools/rbd_mirror/ImageSyncThrottler.h | 6 +- src/tools/rbd_mirror/LeaderWatcher.h | 14 ++-- src/tools/rbd_mirror/MirrorStatusWatcher.h | 4 +- src/tools/rbd_mirror/Replayer.h | 6 +- .../image_replayer/BootstrapRequest.h | 6 +- .../rbd_mirror/image_sync/ImageCopyRequest.h | 4 +- .../image_sync/SnapshotCopyRequest.h | 4 +- 72 files changed, 356 insertions(+), 354 deletions(-) diff --git a/src/librbd/AsyncObjectThrottle.h b/src/librbd/AsyncObjectThrottle.h index 845e4875799..e1b089626c3 100644 --- a/src/librbd/AsyncObjectThrottle.h +++ b/src/librbd/AsyncObjectThrottle.h @@ -33,7 +33,7 @@ public: protected: ImageCtxT &m_image_ctx; - virtual void finish(int r) { + void finish(int r) override { m_finisher.finish_op(r); } @@ -55,7 +55,7 @@ public: uint64_t end_object_no); void start_ops(uint64_t max_concurrent); - virtual void finish_op(int r); + void finish_op(int r) override; private: Mutex m_lock; diff --git a/src/librbd/ExclusiveLock.h b/src/librbd/ExclusiveLock.h index 9947fe380ad..092f7094a6c 100644 --- a/src/librbd/ExclusiveLock.h +++ b/src/librbd/ExclusiveLock.h @@ -29,13 +29,13 @@ public: void handle_peer_notification(int r); protected: - virtual void shutdown_handler(int r, Context *on_finish); - virtual void pre_acquire_lock_handler(Context *on_finish); - virtual void post_acquire_lock_handler(int r, Context *on_finish); - virtual void pre_release_lock_handler(bool shutting_down, - Context *on_finish); - virtual void post_release_lock_handler(bool shutting_down, int r, - Context *on_finish); + void shutdown_handler(int r, Context *on_finish) override; + void pre_acquire_lock_handler(Context *on_finish) override; + void post_acquire_lock_handler(int r, Context *on_finish) override; + void pre_release_lock_handler(bool shutting_down, + Context *on_finish) override; + void post_release_lock_handler(bool shutting_down, int r, + Context *on_finish) override; private: diff --git a/src/librbd/ImageWatcher.h b/src/librbd/ImageWatcher.h index 42d85b32128..14b5a6dc96d 100644 --- a/src/librbd/ImageWatcher.h +++ b/src/librbd/ImageWatcher.h @@ -32,7 +32,7 @@ class ImageWatcher : public Watcher { public: ImageWatcher(ImageCtxT& image_ctx); - virtual ~ImageWatcher(); + ~ImageWatcher() override; void unregister_watch(Context *on_finish); @@ -104,7 +104,7 @@ private: { } - virtual int update_progress(uint64_t offset, uint64_t total) { + int update_progress(uint64_t offset, uint64_t total) override { m_image_watcher.schedule_async_progress(m_async_request_id, offset, total); return 0; @@ -125,11 +125,11 @@ private: { } - virtual ~RemoteContext() { + ~RemoteContext() override { delete m_prog_ctx; } - virtual void finish(int r); + void finish(int r) override; private: ImageWatcher &m_image_watcher; @@ -149,7 +149,7 @@ private: payload(payload) { } - virtual void finish(int r) override { + void finish(int r) override { image_watcher->process_payload(notify_id, handle, payload, r); } }; @@ -159,7 +159,7 @@ private: C_ResponseMessage(watcher::C_NotifyAck *notify_ack) : notify_ack(notify_ack) { } - virtual void finish(int r); + void finish(int r) override; }; ImageCtxT &m_image_ctx; @@ -245,10 +245,10 @@ private: void process_payload(uint64_t notify_id, uint64_t handle, const watch_notify::Payload &payload, int r); - virtual void handle_notify(uint64_t notify_id, uint64_t handle, - uint64_t notifier_id, bufferlist &bl); - virtual void handle_error(uint64_t cookie, int err); - virtual void handle_rewatch_complete(int r); + void handle_notify(uint64_t notify_id, uint64_t handle, + uint64_t notifier_id, bufferlist &bl) override; + void handle_error(uint64_t cookie, int err) override; + void handle_rewatch_complete(int r) override; void send_notify(const watch_notify::Payload& payload, Context *ctx = nullptr); diff --git a/src/librbd/Journal.h b/src/librbd/Journal.h index 8c5084aa152..022ba9c2832 100644 --- a/src/librbd/Journal.h +++ b/src/librbd/Journal.h @@ -221,7 +221,7 @@ private: : journal(_journal), tid(_tid) { } - virtual void finish(int r) { + void finish(int r) override { journal->handle_io_event_safe(r, tid); } }; @@ -239,7 +239,7 @@ private: op_finish_future(op_finish_future), on_safe(on_safe) { } - virtual void finish(int r) { + void finish(int r) override { journal->handle_op_event_safe(r, tid, op_start_future, op_finish_future, on_safe); } @@ -252,7 +252,7 @@ private: C_ReplayProcessSafe(Journal *journal, ReplayEntry &&replay_entry) : journal(journal), replay_entry(std::move(replay_entry)) { } - virtual void finish(int r) { + void finish(int r) override { journal->handle_replay_process_safe(replay_entry, r); } }; @@ -262,17 +262,17 @@ private: ReplayHandler(Journal *_journal) : journal(_journal) { } - virtual void get() { + void get() override { // TODO } - virtual void put() { + void put() override { // TODO } - virtual void handle_entries_available() { + void handle_entries_available() override { journal->handle_replay_ready(); } - virtual void handle_complete(int r) { + void handle_complete(int r) override { journal->handle_replay_complete(r); } }; @@ -315,7 +315,7 @@ private: MetadataListener(Journal *journal) : journal(journal) { } - void handle_update(::journal::JournalMetadata *) { + void handle_update(::journal::JournalMetadata *) override { FunctionContext *ctx = new FunctionContext([this](int r) { journal->handle_metadata_updated(); }); diff --git a/src/librbd/LibrbdAdminSocketHook.h b/src/librbd/LibrbdAdminSocketHook.h index ecd8988f720..cdc2e3db09a 100644 --- a/src/librbd/LibrbdAdminSocketHook.h +++ b/src/librbd/LibrbdAdminSocketHook.h @@ -15,10 +15,10 @@ namespace librbd { class LibrbdAdminSocketHook : public AdminSocketHook { public: LibrbdAdminSocketHook(ImageCtx *ictx); - ~LibrbdAdminSocketHook(); + ~LibrbdAdminSocketHook() override; bool call(std::string command, cmdmap_t& cmdmap, std::string format, - bufferlist& out); + bufferlist& out) override; private: typedef std::map Commands; diff --git a/src/librbd/LibrbdWriteback.h b/src/librbd/LibrbdWriteback.h index 771757b64dc..9c47f98bc18 100644 --- a/src/librbd/LibrbdWriteback.h +++ b/src/librbd/LibrbdWriteback.h @@ -21,28 +21,28 @@ namespace librbd { LibrbdWriteback(ImageCtx *ictx, Mutex& lock); // Note that oloc, trunc_size, and trunc_seq are ignored - virtual 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); + 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) override; // Determine whether a read to this extent could be affected by a // write-triggered copy-on-write - 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; // Note that oloc, trunc_size, and trunc_seq are ignored - virtual 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); + 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) override; using WritebackHandler::write; - virtual void overwrite_extent(const object_t& oid, uint64_t off, - uint64_t len, ceph_tid_t original_journal_tid, - ceph_tid_t new_journal_tid); + void overwrite_extent(const object_t& oid, uint64_t off, + uint64_t len, ceph_tid_t original_journal_tid, + ceph_tid_t new_journal_tid) override; struct write_result_d { bool done; @@ -50,7 +50,7 @@ namespace librbd { std::string oid; Context *oncommit; write_result_d(const std::string& oid, Context *oncommit) : - done(false), ret(0), oid(oid), oncommit(oncommit) {} + done(false), ret(0), oid(oid), oncommit(oncommit) {} private: write_result_d(const write_result_d& rhs); const write_result_d& operator=(const write_result_d& rhs); diff --git a/src/librbd/ManagedLock.h b/src/librbd/ManagedLock.h index 390a4bd4f1d..a4071086d64 100644 --- a/src/librbd/ManagedLock.h +++ b/src/librbd/ManagedLock.h @@ -199,7 +199,7 @@ private: C_ShutDownRelease(ManagedLock *lock) : lock(lock) { } - virtual void finish(int r) override { + void finish(int r) override { lock->send_shutdown_release(); } }; diff --git a/src/librbd/MirroringWatcher.h b/src/librbd/MirroringWatcher.h index 45925b4c7ee..407223bf85c 100644 --- a/src/librbd/MirroringWatcher.h +++ b/src/librbd/MirroringWatcher.h @@ -58,8 +58,8 @@ private: bool handle_payload(const mirroring_watcher::UnknownPayload &payload, Context *on_notify_ack); - virtual void handle_notify(uint64_t notify_id, uint64_t handle, - uint64_t notifier_id, bufferlist &bl); + void handle_notify(uint64_t notify_id, uint64_t handle, + uint64_t notifier_id, bufferlist &bl) override; }; } // namespace librbd diff --git a/src/librbd/TaskFinisher.h b/src/librbd/TaskFinisher.h index e0aebd965f4..172abef7fb3 100644 --- a/src/librbd/TaskFinisher.h +++ b/src/librbd/TaskFinisher.h @@ -119,7 +119,7 @@ private: { } protected: - virtual void finish(int r) { + void finish(int r) override { m_task_finisher->complete(m_task); } private: diff --git a/src/librbd/Utils.h b/src/librbd/Utils.h index c7cf89e9734..705152dcccb 100644 --- a/src/librbd/Utils.h +++ b/src/librbd/Utils.h @@ -50,7 +50,7 @@ public: } protected: - virtual void finish(int r) { + void finish(int r) override { (obj->*MF)(r); } }; @@ -63,7 +63,7 @@ public: } protected: - virtual void complete(int r) override { + void complete(int r) override { Context *on_finish = (obj->*MF)(&r); if (on_finish != nullptr) { on_finish->complete(r); @@ -73,7 +73,7 @@ protected: } Context::complete(r); } - virtual void finish(int r) override { + void finish(int r) override { } }; @@ -85,7 +85,7 @@ struct C_AsyncCallback : public Context { C_AsyncCallback(WQ *op_work_queue, Context *on_finish) : op_work_queue(op_work_queue), on_finish(on_finish) { } - virtual void finish(int r) { + void finish(int r) override { op_work_queue->queue(on_finish, r); } }; diff --git a/src/librbd/Watcher.h b/src/librbd/Watcher.h index f7fb3f48fd7..3e353bdb645 100644 --- a/src/librbd/Watcher.h +++ b/src/librbd/Watcher.h @@ -114,11 +114,11 @@ private: WatchCtx(Watcher &parent) : watcher(parent) {} - virtual void handle_notify(uint64_t notify_id, - uint64_t handle, - uint64_t notifier_id, - bufferlist& bl); - virtual void handle_error(uint64_t handle, int err); + void handle_notify(uint64_t notify_id, + uint64_t handle, + uint64_t notifier_id, + bufferlist& bl) override; + void handle_error(uint64_t handle, int err) override; }; struct C_RegisterWatch : public Context { @@ -128,7 +128,7 @@ private: C_RegisterWatch(Watcher *watcher, Context *on_finish) : watcher(watcher), on_finish(on_finish) { } - virtual void finish(int r) override { + void finish(int r) override { watcher->handle_register_watch(r, on_finish); } }; diff --git a/src/librbd/cache/PassthroughImageCache.h b/src/librbd/cache/PassthroughImageCache.h index aa4ceba69c4..9e451d1a7af 100644 --- a/src/librbd/cache/PassthroughImageCache.h +++ b/src/librbd/cache/PassthroughImageCache.h @@ -22,20 +22,20 @@ public: PassthroughImageCache(ImageCtx &image_ctx); /// client AIO methods - virtual void aio_read(Extents&& image_extents, ceph::bufferlist *bl, - int fadvise_flags, Context *on_finish); - virtual void aio_write(Extents&& image_extents, ceph::bufferlist&& bl, - int fadvise_flags, Context *on_finish); - virtual void aio_discard(uint64_t offset, uint64_t length, - Context *on_finish); - virtual void aio_flush(Context *on_finish); + void aio_read(Extents&& image_extents, ceph::bufferlist *bl, + int fadvise_flags, Context *on_finish) override; + void aio_write(Extents&& image_extents, ceph::bufferlist&& bl, + int fadvise_flags, Context *on_finish) override; + void aio_discard(uint64_t offset, uint64_t length, + Context *on_finish) override; + void aio_flush(Context *on_finish) override; /// internal state methods - virtual void init(Context *on_finish); - virtual void shut_down(Context *on_finish); + void init(Context *on_finish) override; + void shut_down(Context *on_finish) override; - virtual void invalidate(Context *on_finish); - virtual void flush(Context *on_finish); + void invalidate(Context *on_finish) override; + void flush(Context *on_finish) override; private: ImageCtxT &m_image_ctx; diff --git a/src/librbd/exclusive_lock/AutomaticPolicy.h b/src/librbd/exclusive_lock/AutomaticPolicy.h index 6d15542789f..12ba9b6c433 100644 --- a/src/librbd/exclusive_lock/AutomaticPolicy.h +++ b/src/librbd/exclusive_lock/AutomaticPolicy.h @@ -17,11 +17,11 @@ public: AutomaticPolicy(ImageCtx *image_ctx) : m_image_ctx(image_ctx) { } - virtual bool may_auto_request_lock() { + bool may_auto_request_lock() override { return true; } - virtual int lock_requested(bool force); + int lock_requested(bool force) override; private: ImageCtx *m_image_ctx; diff --git a/src/librbd/exclusive_lock/StandardPolicy.h b/src/librbd/exclusive_lock/StandardPolicy.h index 78a346d6656..c756db4f94a 100644 --- a/src/librbd/exclusive_lock/StandardPolicy.h +++ b/src/librbd/exclusive_lock/StandardPolicy.h @@ -17,11 +17,11 @@ public: StandardPolicy(ImageCtx *image_ctx) : m_image_ctx(image_ctx) { } - virtual bool may_auto_request_lock() { + bool may_auto_request_lock() override { return false; } - virtual int lock_requested(bool force); + int lock_requested(bool force) override; private: ImageCtx *m_image_ctx; diff --git a/src/librbd/internal.h b/src/librbd/internal.h index 22cd4bad2b6..64be3a1810f 100644 --- a/src/librbd/internal.h +++ b/src/librbd/internal.h @@ -61,7 +61,7 @@ namespace librbd { NoOpProgressContext() { } - int update_progress(uint64_t offset, uint64_t src_size) + int update_progress(uint64_t offset, uint64_t src_size) override { return 0; } diff --git a/src/librbd/io/AioCompletion.h b/src/librbd/io/AioCompletion.h index 7c2099cf52e..a484365d309 100644 --- a/src/librbd/io/AioCompletion.h +++ b/src/librbd/io/AioCompletion.h @@ -212,8 +212,8 @@ public: C_AioRequest(AioCompletion *completion) : m_completion(completion) { m_completion->add_request(); } - virtual ~C_AioRequest() {} - virtual void finish(int r) { + ~C_AioRequest() override {} + void finish(int r) override { m_completion->complete_request(r); } protected: diff --git a/src/librbd/io/ImageRequest.h b/src/librbd/io/ImageRequest.h index 86ab4bf9aee..0bdca22e63b 100644 --- a/src/librbd/io/ImageRequest.h +++ b/src/librbd/io/ImageRequest.h @@ -83,13 +83,13 @@ public: int op_flags); protected: - virtual void send_request() override; - virtual void send_image_cache_request() override; + void send_request() override; + void send_image_cache_request() override; - virtual aio_type_t get_aio_type() const { + aio_type_t get_aio_type() const override { return AIO_TYPE_READ; } - virtual const char *get_request_type() const { + const char *get_request_type() const override { return "aio_read"; } private: @@ -101,7 +101,7 @@ private: template class AbstractImageWriteRequest : public ImageRequest { public: - virtual bool is_write_op() const { + bool is_write_op() const override { return true; } @@ -121,7 +121,7 @@ protected: m_synchronous(false) { } - virtual void send_request(); + void send_request() override; virtual void prune_object_extents(ObjectExtents &object_extents) { } @@ -162,30 +162,32 @@ protected: using typename ImageRequest::ObjectRequests; using typename AbstractImageWriteRequest::ObjectExtents; - virtual aio_type_t get_aio_type() const { + aio_type_t get_aio_type() const override { return AIO_TYPE_WRITE; } - virtual const char *get_request_type() const { + const char *get_request_type() const override { return "aio_write"; } void assemble_extent(const ObjectExtent &object_extent, bufferlist *bl); - virtual void send_image_cache_request() override; + void send_image_cache_request() override; - virtual void send_object_cache_requests(const ObjectExtents &object_extents, - uint64_t journal_tid); + void send_object_cache_requests(const ObjectExtents &object_extents, + uint64_t journal_tid) override; - virtual void send_object_requests(const ObjectExtents &object_extents, - const ::SnapContext &snapc, - ObjectRequests *object_requests); - virtual ObjectRequestHandle *create_object_request( + void send_object_requests(const ObjectExtents &object_extents, + const ::SnapContext &snapc, + ObjectRequests *aio_object_requests) override; + + ObjectRequestHandle *create_object_request( const ObjectExtent &object_extent, const ::SnapContext &snapc, - Context *on_finish); + Context *on_finish) override; + + uint64_t append_journal_event(const ObjectRequests &requests, + bool synchronous) override; + void update_stats(size_t length) override; - virtual uint64_t append_journal_event(const ObjectRequests &requests, - bool synchronous); - virtual void update_stats(size_t length); private: bufferlist m_bl; int m_op_flags; @@ -203,28 +205,28 @@ protected: using typename ImageRequest::ObjectRequests; using typename AbstractImageWriteRequest::ObjectExtents; - virtual aio_type_t get_aio_type() const { + aio_type_t get_aio_type() const override { return AIO_TYPE_DISCARD; } - virtual const char *get_request_type() const { + const char *get_request_type() const override { return "aio_discard"; } - virtual void prune_object_extents(ObjectExtents &object_extents) override; + void prune_object_extents(ObjectExtents &object_extents) override; - virtual void send_image_cache_request() override; + void send_image_cache_request() override; - virtual uint32_t get_object_cache_request_count(bool journaling) const override; - virtual void send_object_cache_requests(const ObjectExtents &object_extents, - uint64_t journal_tid); + uint32_t get_object_cache_request_count(bool journaling) const override; + void send_object_cache_requests(const ObjectExtents &object_extents, + uint64_t journal_tid) override; - virtual ObjectRequestHandle *create_object_request( + ObjectRequestHandle *create_object_request( const ObjectExtent &object_extent, const ::SnapContext &snapc, - Context *on_finish); + Context *on_finish) override; - virtual uint64_t append_journal_event(const ObjectRequests &requests, - bool synchronous); - virtual void update_stats(size_t length); + uint64_t append_journal_event(const ObjectRequests &requests, + bool synchronous) override; + void update_stats(size_t length) override; }; template @@ -234,23 +236,23 @@ public: : ImageRequest(image_ctx, aio_comp, {}) { } - virtual bool is_write_op() const { + bool is_write_op() const override { return true; } protected: using typename ImageRequest::ObjectRequests; - virtual int clip_request() { + int clip_request() override { return 0; } - virtual void send_request(); - virtual void send_image_cache_request() override; + void send_request() override; + void send_image_cache_request() override; - virtual aio_type_t get_aio_type() const { + aio_type_t get_aio_type() const override { return AIO_TYPE_FLUSH; } - virtual const char *get_request_type() const { + const char *get_request_type() const override { return "aio_flush"; } }; diff --git a/src/librbd/io/ImageRequestWQ.h b/src/librbd/io/ImageRequestWQ.h index 79f5301a683..8bf10be4825 100644 --- a/src/librbd/io/ImageRequestWQ.h +++ b/src/librbd/io/ImageRequestWQ.h @@ -58,8 +58,8 @@ public: void clear_require_lock_on_read(); protected: - virtual void *_void_dequeue(); - virtual void process(ImageRequest *req); + void *_void_dequeue() override; + void process(ImageRequest *req) override; private: typedef std::list Contexts; @@ -72,7 +72,7 @@ private: ImageRequest *aio_image_request) : aio_work_queue(aio_work_queue), aio_image_request(aio_image_request) { } - virtual void finish(int r) override { + void finish(int r) override { aio_work_queue->handle_refreshed(r, aio_image_request); } }; @@ -83,7 +83,7 @@ private: : aio_work_queue(_aio_work_queue) { } - virtual void finish(int r) { + void finish(int r) override { aio_work_queue->handle_blocked_writes(r); } }; diff --git a/src/librbd/io/ObjectRequest.h b/src/librbd/io/ObjectRequest.h index 102e4763212..0467dbb099a 100644 --- a/src/librbd/io/ObjectRequest.h +++ b/src/librbd/io/ObjectRequest.h @@ -73,14 +73,14 @@ public: uint64_t objectno, uint64_t off, uint64_t len, librados::snap_t snap_id, Context *completion, bool hide_enoent); - virtual ~ObjectRequest() {} + ~ObjectRequest() override {} virtual void add_copyup_ops(librados::ObjectWriteOperation *wr) {}; - void complete(int r); + void complete(int r) override; virtual bool should_complete(int r) = 0; - virtual void send() = 0; + void send() override = 0; bool has_parent() const { return m_has_parent; @@ -129,8 +129,8 @@ public: Extents& buffer_extents, librados::snap_t snap_id, bool sparse, Context *completion, int op_flags); - virtual bool should_complete(int r); - virtual void send(); + bool should_complete(int r) override; + void send() override; void guard_read(); inline uint64_t get_offset() const { @@ -149,11 +149,11 @@ public: return m_ext_map; } - const char *get_op_type() const { + const char *get_op_type() const override { return "read"; } - bool pre_object_map_update(uint8_t *new_state) { + bool pre_object_map_update(uint8_t *new_state) override { return false; } @@ -201,13 +201,13 @@ public: uint64_t len, const ::SnapContext &snapc, Context *completion, bool hide_enoent); - virtual void add_copyup_ops(librados::ObjectWriteOperation *wr) + void add_copyup_ops(librados::ObjectWriteOperation *wr) override { add_write_ops(wr); } - virtual bool should_complete(int r); - virtual void send(); + bool should_complete(int r) override; + void send() override; /** * Writes go through the following state machine to deal with @@ -289,23 +289,23 @@ public: m_write_data(data), m_op_flags(op_flags) { } - bool is_op_payload_empty() const { + bool is_op_payload_empty() const override { return (m_write_data.length() == 0); } - virtual const char *get_op_type() const { + const char *get_op_type() const override { return "write"; } - virtual bool pre_object_map_update(uint8_t *new_state) { + bool pre_object_map_update(uint8_t *new_state) override { *new_state = OBJECT_EXISTS; return true; } protected: - virtual void add_write_ops(librados::ObjectWriteOperation *wr); + void add_write_ops(librados::ObjectWriteOperation *wr) override; - virtual void send_write(); + void send_write() override; private: ceph::bufferlist m_write_data; @@ -322,14 +322,14 @@ public: m_object_state(OBJECT_NONEXISTENT) { } - virtual const char* get_op_type() const { + const char* get_op_type() const override { if (has_parent()) { return "remove (trunc)"; } return "remove"; } - virtual bool pre_object_map_update(uint8_t *new_state) { + bool pre_object_map_update(uint8_t *new_state) override { if (has_parent()) { m_object_state = OBJECT_EXISTS; } else { @@ -339,18 +339,18 @@ public: return true; } - virtual bool post_object_map_update() { + bool post_object_map_update() override { if (m_object_state == OBJECT_EXISTS) { return false; } return true; } - virtual void guard_write(); - virtual void send_write(); + void guard_write() override; + void send_write() override; protected: - virtual void add_write_ops(librados::ObjectWriteOperation *wr) { + void add_write_ops(librados::ObjectWriteOperation *wr) override { if (has_parent()) { wr->truncate(0); } else { @@ -375,21 +375,21 @@ public: m_post_object_map_update(post_object_map_update) { } - virtual const char* get_op_type() const { + const char* get_op_type() const override { return "remove (trim)"; } - virtual bool pre_object_map_update(uint8_t *new_state) { + bool pre_object_map_update(uint8_t *new_state) override { *new_state = OBJECT_PENDING; return true; } - virtual bool post_object_map_update() { + bool post_object_map_update() override { return m_post_object_map_update; } protected: - virtual void add_write_ops(librados::ObjectWriteOperation *wr) { + void add_write_ops(librados::ObjectWriteOperation *wr) override { wr->remove(); } @@ -406,11 +406,11 @@ public: completion, true) { } - virtual const char* get_op_type() const { + const char* get_op_type() const override { return "truncate"; } - virtual bool pre_object_map_update(uint8_t *new_state) { + bool pre_object_map_update(uint8_t *new_state) override { if (!m_object_exist && !has_parent()) *new_state = OBJECT_NONEXISTENT; else @@ -418,10 +418,10 @@ public: return true; } - virtual void send_write(); + void send_write() override; protected: - virtual void add_write_ops(librados::ObjectWriteOperation *wr) { + void add_write_ops(librados::ObjectWriteOperation *wr) override { wr->truncate(m_object_off); } }; @@ -435,17 +435,17 @@ public: snapc, completion, true) { } - virtual const char* get_op_type() const { + const char* get_op_type() const override { return "zero"; } - virtual bool pre_object_map_update(uint8_t *new_state) { + bool pre_object_map_update(uint8_t *new_state) override { *new_state = OBJECT_EXISTS; return true; } protected: - virtual void add_write_ops(librados::ObjectWriteOperation *wr) { + void add_write_ops(librados::ObjectWriteOperation *wr) override { wr->zero(m_object_off, m_object_len); } }; diff --git a/src/librbd/journal/DisabledPolicy.h b/src/librbd/journal/DisabledPolicy.h index 0f81ac39be6..c497cab7bc6 100644 --- a/src/librbd/journal/DisabledPolicy.h +++ b/src/librbd/journal/DisabledPolicy.h @@ -14,13 +14,13 @@ namespace journal { class DisabledPolicy : public Policy { public: - virtual bool append_disabled() const { + bool append_disabled() const override { return true; } - virtual bool journal_disabled() const { + bool journal_disabled() const override { return true; } - virtual void allocate_tag_on_lock(Context *on_finish) { + void allocate_tag_on_lock(Context *on_finish) override { assert(false); } }; diff --git a/src/librbd/journal/Replay.h b/src/librbd/journal/Replay.h index 6b7fdd67b74..7587029640b 100644 --- a/src/librbd/journal/Replay.h +++ b/src/librbd/journal/Replay.h @@ -68,7 +68,7 @@ private: C_OpOnComplete(Replay *replay, uint64_t op_tid) : replay(replay), op_tid(op_tid) { } - virtual void finish(int r) override { + void finish(int r) override { replay->handle_op_complete(op_tid, r); } }; @@ -80,7 +80,7 @@ private: C_AioModifyComplete(Replay *replay, Context *on_ready, Context *on_safe) : replay(replay), on_ready(on_ready), on_safe(on_safe) { } - virtual void finish(int r) { + void finish(int r) override { replay->handle_aio_modify_complete(on_ready, on_safe, r); } }; @@ -94,7 +94,7 @@ private: : replay(replay), on_flush_safe(on_flush_safe), on_safe_ctxs(on_safe_ctxs) { } - virtual void finish(int r) { + void finish(int r) override { replay->handle_aio_flush_complete(on_flush_safe, on_safe_ctxs, r); } }; diff --git a/src/librbd/journal/StandardPolicy.h b/src/librbd/journal/StandardPolicy.h index de3f48bb02c..ec8d0148f03 100644 --- a/src/librbd/journal/StandardPolicy.h +++ b/src/librbd/journal/StandardPolicy.h @@ -18,13 +18,13 @@ public: StandardPolicy(ImageCtxT *image_ctx) : m_image_ctx(image_ctx) { } - virtual bool append_disabled() const { + bool append_disabled() const override { return false; } - virtual bool journal_disabled() const { + bool journal_disabled() const override { return false; } - virtual void allocate_tag_on_lock(Context *on_finish); + void allocate_tag_on_lock(Context *on_finish) override; private: ImageCtxT *m_image_ctx; diff --git a/src/librbd/journal/Utils.h b/src/librbd/journal/Utils.h index 7ce48526979..0a272bfd3d3 100644 --- a/src/librbd/journal/Utils.h +++ b/src/librbd/journal/Utils.h @@ -34,11 +34,11 @@ struct C_DecodeTag : public Context { on_finish(on_finish) { } - virtual void complete(int r) override { + void complete(int r) override { on_finish->complete(process(r)); Context::complete(0); } - virtual void finish(int r) override { + void finish(int r) override { } int process(int r); @@ -64,11 +64,11 @@ struct C_DecodeTags : public Context { on_finish(on_finish) { } - virtual void complete(int r) { + void complete(int r) override { on_finish->complete(process(r)); Context::complete(0); } - virtual void finish(int r) override { + void finish(int r) override { } int process(int r); diff --git a/src/librbd/object_map/InvalidateRequest.h b/src/librbd/object_map/InvalidateRequest.h index b051379d0a3..11c420372ac 100644 --- a/src/librbd/object_map/InvalidateRequest.h +++ b/src/librbd/object_map/InvalidateRequest.h @@ -27,11 +27,11 @@ public: m_snap_id(snap_id), m_force(force) { } - virtual void send(); + void send() override; protected: - virtual bool should_complete(int r) override; - virtual int filter_return_code(int r) const override{ + bool should_complete(int r) override; + int filter_return_code(int r) const override{ // never propagate an error back to the caller return 0; } diff --git a/src/librbd/object_map/Request.h b/src/librbd/object_map/Request.h index 6629ad9cbfb..67f9bac11e5 100644 --- a/src/librbd/object_map/Request.h +++ b/src/librbd/object_map/Request.h @@ -23,13 +23,13 @@ public: { } - virtual void send() = 0; + void send() override = 0; protected: const uint64_t m_snap_id; - virtual bool should_complete(int r); - virtual int filter_return_code(int r) const { + bool should_complete(int r) override; + int filter_return_code(int r) const override { // never propagate an error back to the caller return 0; } diff --git a/src/librbd/object_map/ResizeRequest.h b/src/librbd/object_map/ResizeRequest.h index dfe0bcc7e42..5183940075a 100644 --- a/src/librbd/object_map/ResizeRequest.h +++ b/src/librbd/object_map/ResizeRequest.h @@ -30,10 +30,10 @@ public: static void resize(ceph::BitVector<2> *object_map, uint64_t num_objs, uint8_t default_state); - virtual void send(); + void send() override; protected: - virtual void finish_request() override; + void finish_request() override; private: ceph::BitVector<2> *m_object_map; diff --git a/src/librbd/object_map/SnapshotCreateRequest.h b/src/librbd/object_map/SnapshotCreateRequest.h index e68b78ac9a7..31a0886883a 100644 --- a/src/librbd/object_map/SnapshotCreateRequest.h +++ b/src/librbd/object_map/SnapshotCreateRequest.h @@ -50,10 +50,10 @@ public: m_object_map(*object_map), m_ret_val(0) { } - virtual void send(); + void send() override; protected: - virtual bool should_complete(int r); + bool should_complete(int r) override; private: State m_state; diff --git a/src/librbd/object_map/SnapshotRemoveRequest.h b/src/librbd/object_map/SnapshotRemoveRequest.h index 3b196b13c57..6f9e85c48f1 100644 --- a/src/librbd/object_map/SnapshotRemoveRequest.h +++ b/src/librbd/object_map/SnapshotRemoveRequest.h @@ -52,12 +52,12 @@ public: m_snap_id(snap_id), m_next_snap_id(CEPH_NOSNAP) { } - virtual void send(); + void send() override; protected: - virtual bool should_complete(int r); + bool should_complete(int r) override; - virtual int filter_return_code(int r) const { + int filter_return_code(int r) const override { if ((m_state == STATE_LOAD_MAP || m_state == STATE_REMOVE_MAP) && r == -ENOENT) { return 0; diff --git a/src/librbd/object_map/SnapshotRollbackRequest.h b/src/librbd/object_map/SnapshotRollbackRequest.h index dd9430058ea..47d7116cb4b 100644 --- a/src/librbd/object_map/SnapshotRollbackRequest.h +++ b/src/librbd/object_map/SnapshotRollbackRequest.h @@ -50,10 +50,10 @@ public: assert(snap_id != CEPH_NOSNAP); } - virtual void send(); + void send() override; protected: - virtual bool should_complete(int r); + bool should_complete(int r) override; private: State m_state; diff --git a/src/librbd/object_map/UpdateRequest.h b/src/librbd/object_map/UpdateRequest.h index 5f3ae5cd53f..0bb9cd756e2 100644 --- a/src/librbd/object_map/UpdateRequest.h +++ b/src/librbd/object_map/UpdateRequest.h @@ -42,10 +42,10 @@ public: { } - virtual void send(); + void send() override; protected: - virtual void finish_request() override; + void finish_request() override; private: ceph::BitVector<2> &m_object_map; diff --git a/src/librbd/operation/DisableFeaturesRequest.h b/src/librbd/operation/DisableFeaturesRequest.h index e9edaf904c5..7674dfc45ff 100644 --- a/src/librbd/operation/DisableFeaturesRequest.h +++ b/src/librbd/operation/DisableFeaturesRequest.h @@ -29,12 +29,12 @@ public: uint64_t journal_op_tid, uint64_t features); protected: - virtual void send_op(); - virtual bool should_complete(int r); - virtual bool can_affect_io() const override { + void send_op() override; + bool should_complete(int r) override; + bool can_affect_io() const override { return true; } - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::UpdateFeaturesEvent(op_tid, m_features, false); } diff --git a/src/librbd/operation/EnableFeaturesRequest.h b/src/librbd/operation/EnableFeaturesRequest.h index feda681b255..1c91b4dc72a 100644 --- a/src/librbd/operation/EnableFeaturesRequest.h +++ b/src/librbd/operation/EnableFeaturesRequest.h @@ -28,12 +28,12 @@ public: uint64_t journal_op_tid, uint64_t features); protected: - virtual void send_op(); - virtual bool should_complete(int r); - virtual bool can_affect_io() const override { + void send_op() override; + bool should_complete(int r) override; + bool can_affect_io() const override { return true; } - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::UpdateFeaturesEvent(op_tid, m_features, true); } diff --git a/src/librbd/operation/FlattenRequest.h b/src/librbd/operation/FlattenRequest.h index 55e33f40e78..bc1531ddcc7 100644 --- a/src/librbd/operation/FlattenRequest.h +++ b/src/librbd/operation/FlattenRequest.h @@ -28,10 +28,10 @@ public: } protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::FlattenEvent(op_tid); } diff --git a/src/librbd/operation/MetadataRemoveRequest.h b/src/librbd/operation/MetadataRemoveRequest.h index 0b51e11bf39..1d7f2a46afe 100644 --- a/src/librbd/operation/MetadataRemoveRequest.h +++ b/src/librbd/operation/MetadataRemoveRequest.h @@ -23,10 +23,10 @@ public: const std::string &key); protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::MetadataRemoveEvent(op_tid, m_key); } diff --git a/src/librbd/operation/MetadataSetRequest.h b/src/librbd/operation/MetadataSetRequest.h index d6abc3b3cc4..5f8daa2f1c3 100644 --- a/src/librbd/operation/MetadataSetRequest.h +++ b/src/librbd/operation/MetadataSetRequest.h @@ -24,10 +24,10 @@ public: const std::string &key, const std::string &value); protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::MetadataSetEvent(op_tid, m_key, m_value); } diff --git a/src/librbd/operation/ObjectMapIterate.h b/src/librbd/operation/ObjectMapIterate.h index 030df69d54d..b46f8767523 100644 --- a/src/librbd/operation/ObjectMapIterate.h +++ b/src/librbd/operation/ObjectMapIterate.h @@ -34,10 +34,10 @@ public: { } - virtual void send(); + void send() override; protected: - virtual bool should_complete(int r); + bool should_complete(int r) override; private: enum State { diff --git a/src/librbd/operation/RebuildObjectMapRequest.h b/src/librbd/operation/RebuildObjectMapRequest.h index 28361872ce3..1e43f3f4c05 100644 --- a/src/librbd/operation/RebuildObjectMapRequest.h +++ b/src/librbd/operation/RebuildObjectMapRequest.h @@ -24,10 +24,10 @@ public: { } - virtual void send(); + void send() override; protected: - virtual bool should_complete(int r); + bool should_complete(int r) override; private: /** diff --git a/src/librbd/operation/RenameRequest.h b/src/librbd/operation/RenameRequest.h index 95f66588bb4..b0aa5640971 100644 --- a/src/librbd/operation/RenameRequest.h +++ b/src/librbd/operation/RenameRequest.h @@ -55,10 +55,10 @@ public: const std::string &dest_name); protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::RenameEvent(op_tid, m_dest_name); } diff --git a/src/librbd/operation/Request.h b/src/librbd/operation/Request.h index 78993160bf6..8eaca29b1d1 100644 --- a/src/librbd/operation/Request.h +++ b/src/librbd/operation/Request.h @@ -22,10 +22,10 @@ public: Request(ImageCtxT &image_ctx, Context *on_finish, uint64_t journal_op_tid = 0); - virtual void send(); + void send(); protected: - virtual void finish(int r) override; + void finish(int r) override; virtual void send_op() = 0; virtual bool can_affect_io() const { @@ -58,7 +58,7 @@ protected: // NOTE: temporary until converted to new state machine format Context *create_context_finisher(int r); - virtual void finish_and_destroy(int r) override; + void finish_and_destroy(int r) override; private: struct C_AppendOpEvent : public Context { @@ -67,7 +67,7 @@ private: C_AppendOpEvent(Request *request, Context *on_safe) : request(request), on_safe(on_safe) { } - virtual void finish(int r) override { + void finish(int r) override { if (r >= 0) { request->m_appended_op_event = true; } @@ -81,7 +81,7 @@ private: C_CommitOpEvent(Request *request, int ret_val) : request(request), ret_val(ret_val) { } - virtual void finish(int r) override { + void finish(int r) override { request->handle_commit_op_event(r, ret_val); delete request; } diff --git a/src/librbd/operation/ResizeRequest.h b/src/librbd/operation/ResizeRequest.h index 7b9ff6d8eb0..4ec79c373be 100644 --- a/src/librbd/operation/ResizeRequest.h +++ b/src/librbd/operation/ResizeRequest.h @@ -28,7 +28,7 @@ public: ResizeRequest(ImageCtxT &image_ctx, Context *on_finish, uint64_t new_size, bool allow_shrink, ProgressContext &prog_ctx, uint64_t journal_op_tid, bool disable_journal); - virtual ~ResizeRequest(); + ~ResizeRequest() override; inline bool shrinking() const { return (m_shrink_size_visible && m_new_size < m_original_size); @@ -38,17 +38,17 @@ public: return m_new_size; } - virtual void send(); + void send() override; protected: - virtual void send_op(); - virtual bool should_complete(int r) { + void send_op() override; + bool should_complete(int r) override { return true; } - virtual bool can_affect_io() const override { + bool can_affect_io() const override { return true; } - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::ResizeEvent(op_tid, m_new_size); } diff --git a/src/librbd/operation/SnapshotCreateRequest.h b/src/librbd/operation/SnapshotCreateRequest.h index 16458260409..e1e4beb5503 100644 --- a/src/librbd/operation/SnapshotCreateRequest.h +++ b/src/librbd/operation/SnapshotCreateRequest.h @@ -66,14 +66,14 @@ public: bool skip_object_map); protected: - virtual void send_op(); - virtual bool should_complete(int r) { + void send_op() override; + bool should_complete(int r) override { return true; } - virtual bool can_affect_io() const override { + bool can_affect_io() const override { return true; } - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::SnapCreateEvent(op_tid, m_snap_name, m_snap_namespace); } diff --git a/src/librbd/operation/SnapshotLimitRequest.h b/src/librbd/operation/SnapshotLimitRequest.h index bcd205b3d16..09622a45960 100644 --- a/src/librbd/operation/SnapshotLimitRequest.h +++ b/src/librbd/operation/SnapshotLimitRequest.h @@ -23,10 +23,10 @@ public: uint64_t limit); protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::SnapLimitEvent(op_tid, m_snap_limit); } diff --git a/src/librbd/operation/SnapshotProtectRequest.h b/src/librbd/operation/SnapshotProtectRequest.h index b905ff50f4a..764da65da0c 100644 --- a/src/librbd/operation/SnapshotProtectRequest.h +++ b/src/librbd/operation/SnapshotProtectRequest.h @@ -42,10 +42,10 @@ public: const std::string &snap_name); protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::SnapProtectEvent(op_tid, m_snap_name); } diff --git a/src/librbd/operation/SnapshotRemoveRequest.h b/src/librbd/operation/SnapshotRemoveRequest.h index 39123ff8ee8..40c12c5c923 100644 --- a/src/librbd/operation/SnapshotRemoveRequest.h +++ b/src/librbd/operation/SnapshotRemoveRequest.h @@ -60,10 +60,10 @@ public: const std::string &snap_name, uint64_t snap_id); protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::SnapRemoveEvent(op_tid, m_snap_name); } diff --git a/src/librbd/operation/SnapshotRenameRequest.h b/src/librbd/operation/SnapshotRenameRequest.h index 0b512ecb575..697772e024b 100644 --- a/src/librbd/operation/SnapshotRenameRequest.h +++ b/src/librbd/operation/SnapshotRenameRequest.h @@ -41,11 +41,11 @@ public: SnapshotRenameRequest(ImageCtxT &image_ctx, Context *on_finish, uint64_t snap_id, const std::string &snap_name); - virtual journal::Event create_event(uint64_t op_tid) const; + journal::Event create_event(uint64_t op_tid) const override; protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; private: uint64_t m_snap_id; diff --git a/src/librbd/operation/SnapshotRollbackRequest.h b/src/librbd/operation/SnapshotRollbackRequest.h index 135ba979455..5d1cb69e85c 100644 --- a/src/librbd/operation/SnapshotRollbackRequest.h +++ b/src/librbd/operation/SnapshotRollbackRequest.h @@ -59,15 +59,15 @@ public: SnapshotRollbackRequest(ImageCtxT &image_ctx, Context *on_finish, const std::string &snap_name, uint64_t snap_id, uint64_t snap_size, ProgressContext &prog_ctx); - virtual ~SnapshotRollbackRequest(); + ~SnapshotRollbackRequest() override; protected: - virtual void send_op(); - virtual bool should_complete(int r) { + void send_op() override; + bool should_complete(int r) override { return true; } - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::SnapRollbackEvent(op_tid, m_snap_name); } diff --git a/src/librbd/operation/SnapshotUnprotectRequest.h b/src/librbd/operation/SnapshotUnprotectRequest.h index c9f5b335ade..7930592f57e 100644 --- a/src/librbd/operation/SnapshotUnprotectRequest.h +++ b/src/librbd/operation/SnapshotUnprotectRequest.h @@ -53,17 +53,17 @@ public: const std::string &snap_name); protected: - virtual void send_op(); - virtual bool should_complete(int r); + void send_op() override; + bool should_complete(int r) override; - virtual int filter_return_code(int r) const { + int filter_return_code(int r) const override { if (m_ret_val < 0) { return m_ret_val; } return 0; } - virtual journal::Event create_event(uint64_t op_tid) const { + journal::Event create_event(uint64_t op_tid) const override { return journal::SnapUnprotectEvent(op_tid, m_snap_name); } diff --git a/src/librbd/operation/TrimRequest.h b/src/librbd/operation/TrimRequest.h index 814d1802309..5eb9fdffe38 100644 --- a/src/librbd/operation/TrimRequest.h +++ b/src/librbd/operation/TrimRequest.h @@ -24,7 +24,7 @@ public: prog_ctx); } - virtual void send(); + void send() override; protected: /** @@ -77,7 +77,7 @@ protected: STATE_FINISHED }; - virtual bool should_complete(int r); + bool should_complete(int r) override; State m_state; diff --git a/src/librbd/watcher/Notifier.h b/src/librbd/watcher/Notifier.h index c45e9ac90f6..609c2ada739 100644 --- a/src/librbd/watcher/Notifier.h +++ b/src/librbd/watcher/Notifier.h @@ -37,7 +37,7 @@ private: C_AioNotify(Notifier *notifier, Context *on_finish) : notifier(notifier), on_finish(on_finish) { } - virtual void finish(int r) override { + void finish(int r) override { notifier->handle_notify(r, on_finish); } }; diff --git a/src/librbd/watcher/Types.h b/src/librbd/watcher/Types.h index 0f11ab8885a..504f8e4e781 100644 --- a/src/librbd/watcher/Types.h +++ b/src/librbd/watcher/Types.h @@ -26,7 +26,7 @@ struct C_NotifyAck : public Context { bufferlist out; C_NotifyAck(Watcher *watcher, uint64_t notify_id, uint64_t handle); - void finish(int r); + void finish(int r) override; }; template diff --git a/src/rbd_replay/Replayer.hpp b/src/rbd_replay/Replayer.hpp index 5cb5ee57eeb..cbc7739df5b 100644 --- a/src/rbd_replay/Replayer.hpp +++ b/src/rbd_replay/Replayer.hpp @@ -36,31 +36,31 @@ public: void start(); /// Should only be called by StopThreadAction - void stop(); + void stop() override; void join(); void send(Action::ptr action); - void add_pending(PendingIO::ptr io); + void add_pending(PendingIO::ptr io) override; - void remove_pending(PendingIO::ptr io); + void remove_pending(PendingIO::ptr io) override; - librbd::Image* get_image(imagectx_id_t imagectx_id); + librbd::Image* get_image(imagectx_id_t imagectx_id) override; - void put_image(imagectx_id_t imagectx_id, librbd::Image* image); + void put_image(imagectx_id_t imagectx_id, librbd::Image* image) override; - void erase_image(imagectx_id_t imagectx_id); + void erase_image(imagectx_id_t imagectx_id) override; - librbd::RBD* rbd(); + librbd::RBD* rbd() override; - librados::IoCtx* ioctx(); + librados::IoCtx* ioctx() override; - void set_action_complete(action_id_t id); + void set_action_complete(action_id_t id) override; - bool readonly() const; + bool readonly() const override; - rbd_loc map_image_name(std::string image_name, std::string snap_name) const; + rbd_loc map_image_name(std::string image_name, std::string snap_name) const override; private: void run(); diff --git a/src/rbd_replay/actions.hpp b/src/rbd_replay/actions.hpp index df5dde48459..b191448f626 100644 --- a/src/rbd_replay/actions.hpp +++ b/src/rbd_replay/actions.hpp @@ -127,19 +127,19 @@ public: explicit TypedAction(const ActionType &action) : m_action(action) { } - virtual action_id_t id() const { + action_id_t id() const override { return m_action.id; } - virtual thread_id_t thread_id() const { + thread_id_t thread_id() const override { return m_action.thread_id; } - virtual const action::Dependencies& predecessors() const { + const action::Dependencies& predecessors() const override { return m_action.dependencies; } - virtual std::ostream& dump(std::ostream& o) const { + std::ostream& dump(std::ostream& o) const override { o << get_action_name() << ": "; ceph::JSONFormatter formatter(false); formatter.open_object_section(""); @@ -165,13 +165,13 @@ public: : TypedAction(action) { } - virtual bool is_start_thread() { + bool is_start_thread() override { return true; } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "StartThreadAction"; } }; @@ -182,10 +182,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "StartThreadAction"; } }; @@ -197,10 +197,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "AioReadAction"; } }; @@ -212,10 +212,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "ReadAction"; } }; @@ -227,10 +227,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "AioWriteAction"; } }; @@ -242,10 +242,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "WriteAction"; } }; @@ -257,10 +257,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "AioDiscardAction"; } }; @@ -272,10 +272,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "DiscardAction"; } }; @@ -287,10 +287,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "OpenImageAction"; } }; @@ -302,10 +302,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "CloseImageAction"; } }; @@ -316,10 +316,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "AioOpenImageAction"; } }; @@ -331,10 +331,10 @@ public: : TypedAction(action) { } - virtual void perform(ActionCtx &ctx); + void perform(ActionCtx &ctx) override; protected: - virtual const char *get_action_name() const { + const char *get_action_name() const override { return "AioCloseImageAction"; } }; diff --git a/src/rbd_replay/ios.hpp b/src/rbd_replay/ios.hpp index 5f19648b9e6..d8f58618650 100644 --- a/src/rbd_replay/ios.hpp +++ b/src/rbd_replay/ios.hpp @@ -117,9 +117,9 @@ public: : IO(ionum, start_time, thread_id, io_set_t()) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; }; class StopThreadIO : public IO { @@ -131,9 +131,9 @@ public: : IO(ionum, start_time, thread_id, deps) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; }; class ReadIO : public IO { @@ -151,9 +151,9 @@ public: m_length(length) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -176,9 +176,9 @@ public: m_length(length) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -201,9 +201,9 @@ public: m_length(length) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -226,9 +226,9 @@ public: m_length(length) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -251,9 +251,9 @@ public: m_length(length) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -276,9 +276,9 @@ public: m_length(length) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -303,13 +303,13 @@ public: m_readonly(readonly) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; imagectx_id_t imagectx() const { return m_imagectx; } - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -329,13 +329,13 @@ public: m_imagectx(imagectx) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; imagectx_id_t imagectx() const { return m_imagectx; } - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -358,13 +358,13 @@ public: m_readonly(readonly) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; imagectx_id_t imagectx() const { return m_imagectx; } - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; @@ -384,13 +384,13 @@ public: m_imagectx(imagectx) { } - virtual void encode(bufferlist &bl) const; + void encode(bufferlist &bl) const override; imagectx_id_t imagectx() const { return m_imagectx; } - void write_debug(std::ostream& out) const; + void write_debug(std::ostream& out) const override; private: imagectx_id_t m_imagectx; diff --git a/src/test/librbd/io/test_mock_ImageRequest.cc b/src/test/librbd/io/test_mock_ImageRequest.cc index de27ef8b1ed..b5950ce66a9 100644 --- a/src/test/librbd/io/test_mock_ImageRequest.cc +++ b/src/test/librbd/io/test_mock_ImageRequest.cc @@ -82,7 +82,7 @@ struct ObjectRequest : public ObjectRequestHandle { assert(s_instance == nullptr); s_instance = this; } - ~ObjectRequest() { + ~ObjectRequest() override { s_instance = nullptr; } @@ -112,7 +112,7 @@ struct ObjectReadRequest : public ObjectRequest &get_mock_rados_client() { return *s_mock_rados_client; diff --git a/src/test/rbd_mirror/test_ClusterWatcher.cc b/src/test/rbd_mirror/test_ClusterWatcher.cc index 6c081c4b3b1..43da46f4ce6 100644 --- a/src/test/rbd_mirror/test_ClusterWatcher.cc +++ b/src/test/rbd_mirror/test_ClusterWatcher.cc @@ -36,7 +36,7 @@ public: m_cluster_watcher.reset(new ClusterWatcher(m_cluster, m_lock)); } - ~TestClusterWatcher() { + ~TestClusterWatcher() override { m_cluster->wait_for_latest_osdmap(); for (auto& pool : m_pools) { EXPECT_EQ(0, m_cluster->pool_delete(pool.c_str())); diff --git a/src/test/rbd_mirror/test_PoolWatcher.cc b/src/test/rbd_mirror/test_PoolWatcher.cc index 433873b8586..201934e3dca 100644 --- a/src/test/rbd_mirror/test_PoolWatcher.cc +++ b/src/test/rbd_mirror/test_PoolWatcher.cc @@ -48,7 +48,7 @@ TestPoolWatcher() : m_lock("TestPoolWatcherLock"), EXPECT_EQ("", connect_cluster_pp(*m_cluster)); } - ~TestPoolWatcher() { + ~TestPoolWatcher() override { m_cluster->wait_for_latest_osdmap(); for (auto& pool : m_pools) { EXPECT_EQ(0, m_cluster->pool_delete(pool.c_str())); diff --git a/src/test/rbd_mirror/test_fixture.h b/src/test/rbd_mirror/test_fixture.h index ce751409148..41526dbdc22 100644 --- a/src/test/rbd_mirror/test_fixture.h +++ b/src/test/rbd_mirror/test_fixture.h @@ -26,8 +26,8 @@ public: static void SetUpTestCase(); static void TearDownTestCase(); - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; librados::IoCtx m_local_io_ctx; librados::IoCtx m_remote_io_ctx; diff --git a/src/test/rbd_mirror/test_mock_fixture.h b/src/test/rbd_mirror/test_mock_fixture.h index 0952f9c3b74..77a36ddc6d8 100644 --- a/src/test/rbd_mirror/test_mock_fixture.h +++ b/src/test/rbd_mirror/test_mock_fixture.h @@ -39,8 +39,8 @@ public: static void SetUpTestCase(); static void TearDownTestCase(); - virtual void SetUp(); - virtual void TearDown(); + void SetUp() override; + void TearDown() override; void expect_test_features(librbd::MockImageCtx &mock_image_ctx); diff --git a/src/tools/rbd/IndentStream.h b/src/tools/rbd/IndentStream.h index ba7d90bc96b..85ccc85b381 100644 --- a/src/tools/rbd/IndentStream.h +++ b/src/tools/rbd/IndentStream.h @@ -25,7 +25,7 @@ public: } protected: - virtual int overflow (int c); + int overflow (int c) override; private: size_t m_indent; diff --git a/src/tools/rbd/Utils.h b/src/tools/rbd/Utils.h index 0023d431dfe..bc23a2f0c58 100644 --- a/src/tools/rbd/Utils.h +++ b/src/tools/rbd/Utils.h @@ -54,7 +54,7 @@ struct ProgressContext : public librbd::ProgressContext { : operation(o), progress(!no_progress), last_pc(0) { } - int update_progress(uint64_t offset, uint64_t total); + int update_progress(uint64_t offset, uint64_t total) override; void finish(); void fail(); }; diff --git a/src/tools/rbd_mirror/ImageDeleter.h b/src/tools/rbd_mirror/ImageDeleter.h index 64d0671dfb2..ff5f4e535f4 100644 --- a/src/tools/rbd_mirror/ImageDeleter.h +++ b/src/tools/rbd_mirror/ImageDeleter.h @@ -68,7 +68,7 @@ private: public: ImageDeleterThread(ImageDeleter *image_deleter) : m_image_deleter(image_deleter) {} - void *entry() { + void *entry() override { m_image_deleter->run(); return 0; } diff --git a/src/tools/rbd_mirror/ImageReplayer.h b/src/tools/rbd_mirror/ImageReplayer.h index 41c3fac37c9..da3d107a5f3 100644 --- a/src/tools/rbd_mirror/ImageReplayer.h +++ b/src/tools/rbd_mirror/ImageReplayer.h @@ -244,15 +244,15 @@ private: : img_replayer(img_replayer) { } - virtual void handle_close() { + void handle_close() override { img_replayer->on_stop_journal_replay(); } - virtual void handle_promoted() { + void handle_promoted() override { img_replayer->on_stop_journal_replay(0, "force promoted"); } - virtual void handle_resync() { + void handle_resync() override { img_replayer->resync_image(); } }; @@ -263,8 +263,8 @@ private: replayer(replayer) { } - virtual void update_progress(const std::string &description, - bool flush = true); + void update_progress(const std::string &description, + bool flush = true) override; private: ImageReplayer *replayer; }; @@ -334,7 +334,7 @@ private: RemoteJournalerListener(ImageReplayer *replayer) : replayer(replayer) { } - void handle_update(::journal::JournalMetadata *); + void handle_update(::journal::JournalMetadata *) override; } m_remote_listener; struct C_ReplayCommitted : public Context { @@ -345,7 +345,7 @@ private: ReplayEntry &&replay_entry) : replayer(replayer), replay_entry(std::move(replay_entry)) { } - virtual void finish(int r) { + void finish(int r) override { replayer->handle_process_entry_safe(replay_entry, r); } }; diff --git a/src/tools/rbd_mirror/ImageSync.h b/src/tools/rbd_mirror/ImageSync.h index 97bad5471c4..42bbcc51d4f 100644 --- a/src/tools/rbd_mirror/ImageSync.h +++ b/src/tools/rbd_mirror/ImageSync.h @@ -51,10 +51,10 @@ public: Journaler *journaler, MirrorPeerClientMeta *client_meta, ContextWQ *work_queue, Context *on_finish, ProgressContext *progress_ctx = nullptr); - ~ImageSync(); + ~ImageSync() override; - void send(); - void cancel(); + void send() override; + void cancel() override; private: /** diff --git a/src/tools/rbd_mirror/ImageSyncThrottler.h b/src/tools/rbd_mirror/ImageSyncThrottler.h index 76062b2098a..abe01e43695 100644 --- a/src/tools/rbd_mirror/ImageSyncThrottler.h +++ b/src/tools/rbd_mirror/ImageSyncThrottler.h @@ -49,7 +49,7 @@ public: typedef librbd::journal::MirrorPeerClientMeta MirrorPeerClientMeta; ImageSyncThrottler(); - ~ImageSyncThrottler(); + ~ImageSyncThrottler() override; ImageSyncThrottler(const ImageSyncThrottler&) = delete; ImageSyncThrottler& operator=(const ImageSyncThrottler&) = delete; @@ -74,9 +74,9 @@ private: void handle_sync_finished(C_SyncHolder *sync_holder); - const char **get_tracked_conf_keys() const; + const char **get_tracked_conf_keys() const override; void handle_conf_change(const struct md_config_t *conf, - const std::set &changed); + const std::set &changed) override; uint32_t m_max_concurrent_syncs; Mutex m_lock; diff --git a/src/tools/rbd_mirror/LeaderWatcher.h b/src/tools/rbd_mirror/LeaderWatcher.h index 8a2c6f72804..8d5fd5dae85 100644 --- a/src/tools/rbd_mirror/LeaderWatcher.h +++ b/src/tools/rbd_mirror/LeaderWatcher.h @@ -104,7 +104,7 @@ private: } protected: - virtual void post_acquire_lock_handler(int r, Context *on_finish) { + void post_acquire_lock_handler(int r, Context *on_finish) { if (r == 0) { // lock is owned at this point Mutex::Locker locker(Parent::m_lock); @@ -112,12 +112,12 @@ private: } watcher->handle_post_acquire_leader_lock(r, on_finish); } - virtual void pre_release_lock_handler(bool shutting_down, - Context *on_finish) { + void pre_release_lock_handler(bool shutting_down, + Context *on_finish) { watcher->handle_pre_release_leader_lock(on_finish); } - virtual void post_release_lock_handler(bool shutting_down, int r, - Context *on_finish) { + void post_release_lock_handler(bool shutting_down, int r, + Context *on_finish) { watcher->handle_post_release_leader_lock(r, on_finish); } private: @@ -146,7 +146,7 @@ private: : leader_watcher(leader_watcher) { } - virtual void finish(int r) { + void finish(int r) override { leader_watcher->handle_get_locker(r, locker); } }; @@ -220,7 +220,7 @@ private: void handle_post_release_leader_lock(int r, Context *on_finish); void handle_notify(uint64_t notify_id, uint64_t handle, - uint64_t notifier_id, bufferlist &bl); + uint64_t notifier_id, bufferlist &bl) override; void handle_heartbeat(Context *on_ack); void handle_lock_acquired(Context *on_ack); diff --git a/src/tools/rbd_mirror/MirrorStatusWatcher.h b/src/tools/rbd_mirror/MirrorStatusWatcher.h index 0349e97abde..f9d9227b3c1 100644 --- a/src/tools/rbd_mirror/MirrorStatusWatcher.h +++ b/src/tools/rbd_mirror/MirrorStatusWatcher.h @@ -17,8 +17,8 @@ public: void shut_down(Context *on_finish); protected: - virtual void handle_notify(uint64_t notify_id, uint64_t handle, - uint64_t notifier_id, bufferlist &bl); + void handle_notify(uint64_t notify_id, uint64_t handle, + uint64_t notifier_id, bufferlist &bl) override; }; } // namespace mirror diff --git a/src/tools/rbd_mirror/Replayer.h b/src/tools/rbd_mirror/Replayer.h index 42db5ec964d..36dc074320f 100644 --- a/src/tools/rbd_mirror/Replayer.h +++ b/src/tools/rbd_mirror/Replayer.h @@ -99,7 +99,7 @@ private: Replayer *m_replayer; public: ReplayerThread(Replayer *replayer) : m_replayer(replayer) {} - void *entry() { + void *entry() override { m_replayer->run(); return 0; } @@ -111,11 +111,11 @@ private: } protected: - virtual void post_acquire_handler(Context *on_finish) { + void post_acquire_handler(Context *on_finish) override { m_replayer->handle_post_acquire_leader(on_finish); } - virtual void pre_release_handler(Context *on_finish) { + void pre_release_handler(Context *on_finish) override { m_replayer->handle_pre_release_leader(on_finish); } diff --git a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h index 6b4ed215a0f..0d7017e7053 100644 --- a/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h +++ b/src/tools/rbd_mirror/image_replayer/BootstrapRequest.h @@ -75,10 +75,10 @@ public: const std::string &remote_mirror_uuid, Journaler *journaler, MirrorPeerClientMeta *client_meta, Context *on_finish, bool *do_resync, ProgressContext *progress_ctx = nullptr); - ~BootstrapRequest(); + ~BootstrapRequest() override; - void send(); - void cancel(); + void send() override; + void cancel() override; private: /** diff --git a/src/tools/rbd_mirror/image_sync/ImageCopyRequest.h b/src/tools/rbd_mirror/image_sync/ImageCopyRequest.h index 85dfe9b2831..4be826aa127 100644 --- a/src/tools/rbd_mirror/image_sync/ImageCopyRequest.h +++ b/src/tools/rbd_mirror/image_sync/ImageCopyRequest.h @@ -55,8 +55,8 @@ public: MirrorPeerSyncPoint *sync_point, Context *on_finish, ProgressContext *progress_ctx = nullptr); - void send(); - void cancel(); + void send() override; + void cancel() override; private: /** diff --git a/src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h b/src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h index 77f77722877..bd8b7ef932c 100644 --- a/src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h +++ b/src/tools/rbd_mirror/image_sync/SnapshotCopyRequest.h @@ -50,8 +50,8 @@ public: librbd::journal::MirrorPeerClientMeta *client_meta, ContextWQ *work_queue, Context *on_finish); - void send(); - void cancel(); + void send() override; + void cancel() override; private: /** -- 2.39.5