]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: add override in rbd subsystem 13437/head
authorliuchang0812 <liuchang0812@gmail.com>
Wed, 15 Feb 2017 13:37:31 +0000 (21:37 +0800)
committerliuchang0812 <liuchang0812@gmail.com>
Fri, 17 Feb 2017 11:13:20 +0000 (19:13 +0800)
Fixes: http://tracker.ceph.com/issues/18922
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
61 files changed:
src/librbd/AioImageRequest.cc
src/librbd/AsyncOperation.cc
src/librbd/CopyupRequest.cc
src/librbd/DiffIterate.cc
src/librbd/ExclusiveLock.cc
src/librbd/ImageCtx.cc
src/librbd/ImageState.cc
src/librbd/Journal.cc
src/librbd/LibrbdAdminSocketHook.cc
src/librbd/LibrbdWriteback.cc
src/librbd/ManagedLock.cc
src/librbd/Operations.cc
src/librbd/Watcher.cc
src/librbd/internal.cc
src/librbd/journal/Replay.cc
src/librbd/librbd.cc
src/librbd/managed_lock/BreakRequest.cc
src/librbd/operation/FlattenRequest.cc
src/librbd/operation/ObjectMapIterate.cc
src/librbd/operation/SnapshotRollbackRequest.cc
src/librbd/operation/SnapshotUnprotectRequest.cc
src/librbd/operation/TrimRequest.cc
src/test/cls_rbd/test_cls_rbd.cc
src/test/librbd/fsx.cc
src/test/librbd/journal/test_Entries.cc
src/test/librbd/test_BlockGuard.cc
src/test/librbd/test_ImageWatcher.cc
src/test/librbd/test_MirroringWatcher.cc
src/test/librbd/test_internal.cc
src/test/librbd/test_librbd.cc
src/test/librbd/test_mirroring.cc
src/test/librbd/test_mock_Journal.cc
src/test/librbd/watcher/test_mock_RewatchRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_BootstrapRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_EventPreprocessor.cc
src/test/rbd_mirror/image_sync/test_mock_ImageCopyRequest.cc
src/test/rbd_mirror/image_sync/test_mock_ObjectCopyRequest.cc
src/test/rbd_mirror/image_sync/test_mock_SnapshotCopyRequest.cc
src/test/rbd_mirror/image_sync/test_mock_SnapshotCreateRequest.cc
src/test/rbd_mirror/image_sync/test_mock_SyncPointCreateRequest.cc
src/test/rbd_mirror/image_sync/test_mock_SyncPointPruneRequest.cc
src/test/rbd_mirror/test_ImageDeleter.cc
src/test/rbd_mirror/test_ImageReplayer.cc
src/test/rbd_mirror/test_ImageSync.cc
src/test/rbd_mirror/test_LeaderWatcher.cc
src/test/rbd_mirror/test_mock_ImageReplayer.cc
src/test/rbd_mirror/test_mock_ImageSync.cc
src/test/rbd_mirror/test_mock_ImageSyncThrottler.cc
src/tools/rbd/action/Export.cc
src/tools/rbd/action/ExportDiff.cc
src/tools/rbd/action/Import.cc
src/tools/rbd/action/Journal.cc
src/tools/rbd/action/Watch.cc
src/tools/rbd_mirror/ImageDeleter.cc
src/tools/rbd_mirror/ImageReplayer.cc
src/tools/rbd_mirror/ImageSyncThrottler.cc
src/tools/rbd_mirror/Mirror.cc
src/tools/rbd_mirror/Replayer.cc
src/tools/rbd_mirror/image_replayer/OpenLocalImageRequest.cc
src/tools/rbd_nbd/rbd-nbd.cc

index e3a75d634b44d953662b3076cc8a0166009ad3dc..a262d8c5550cf07a0d78e760708c654b66f7a1e3 100644 (file)
@@ -44,7 +44,7 @@ struct C_DiscardJournalCommit : public Context {
     aio_comp->add_request();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     CephContext *cct = image_ctx.cct;
     ldout(cct, 20) << this << " C_DiscardJournalCommit: "
                    << "journal committed: discarding from cache" << dendl;
@@ -71,7 +71,7 @@ struct C_FlushJournalCommit : public Context {
     aio_comp->add_request();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     CephContext *cct = image_ctx.cct;
     ldout(cct, 20) << this << " C_FlushJournalCommit: journal committed"
                    << dendl;
@@ -86,7 +86,7 @@ public:
     : C_AioRequest(completion), m_req(nullptr) {
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     m_completion->lock.Lock();
     CephContext *cct = m_completion->ictx->cct;
     ldout(cct, 10) << "C_AioRead::finish() " << this << " r = " << r << dendl;
@@ -133,7 +133,7 @@ public:
   }
 
 protected:
-  virtual void finish(int r) {
+  void finish(int r) override {
     CephContext *cct = m_completion->ictx->cct;
     ldout(cct, 10) << "C_ImageCacheRead::finish() " << this << ": r=" << r
                    << dendl;
@@ -163,7 +163,7 @@ public:
   explicit C_ObjectCacheRead(ImageCtxT &ictx, AioObjectRead<ImageCtxT> *req)
     : m_image_ctx(ictx), m_req(req), m_enqueued(false) {}
 
-  virtual void complete(int r) {
+  void complete(int r) override {
     if (!m_enqueued) {
       // cache_lock creates a lock ordering issue -- so re-execute this context
       // outside the cache_lock
@@ -175,7 +175,7 @@ public:
   }
 
 protected:
-  virtual void finish(int r) {
+  void finish(int r) override {
     m_req->complete(r);
   }
 
index 0c79d8ac3ca9f2234f18f8f0124dc368db7e5efe..d6581c9e9368f8cdc98edb0c3bf7c7ecf5a7d88b 100644 (file)
@@ -21,7 +21,7 @@ struct C_CompleteFlushes : public Context {
   explicit C_CompleteFlushes(ImageCtx *image_ctx, std::list<Context *> &&flush_contexts)
     : image_ctx(image_ctx), flush_contexts(std::move(flush_contexts)) {
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     RWLock::RLocker owner_locker(image_ctx->owner_lock);
     while (!flush_contexts.empty()) {
       Context *flush_ctx = flush_contexts.front();
index e7dd8a45df065f8620cd967836ec99f62f6748d4..ae3f1770c2b97d51561434985be4815cf926719a 100644 (file)
@@ -38,7 +38,7 @@ public:
   {
   }
 
-  virtual int send() {
+  int send() override {
     uint64_t snap_id = m_snap_ids[m_snap_id_idx];
     if (snap_id == CEPH_NOSNAP) {
       RWLock::RLocker snap_locker(m_image_ctx.snap_lock);
index 57a847f20b2f2601a2e516308e07461c051c2cf3..dc4de7f793bff48c78faa9ee3b8be13ca0d5670a 100644 (file)
@@ -75,7 +75,7 @@ protected:
   typedef boost::tuple<uint64_t, size_t, bool> Diff;
   typedef std::list<Diff> Diffs;
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     CephContext *cct = m_image_ctx.cct;
     if (r == 0 && m_snap_ret < 0) {
       r = m_snap_ret;
index bd136a7aed7894cfa19baa22030faef1af88d01c..1a7a76ccb34c5bae735042ed5be6569e0dde5a3d 100644 (file)
@@ -303,7 +303,7 @@ struct ExclusiveLock<I>::C_InitComplete : public Context {
                  Context *on_init)
     : exclusive_lock(exclusive_lock), features(features), on_init(on_init) {
   }
-  virtual void finish(int r) override {
+  void finish(int r) override {
     if (r == 0) {
       exclusive_lock->handle_init_complete(features);
     }
index bc3132a912fe0169df0eaf9e8cbbde93b1a19216..fa6724d4b85cf8cd11170bad503fda9759975cb3 100644 (file)
@@ -59,7 +59,7 @@ public:
                  "rbd_op_threads") {
     start();
   }
-  virtual ~ThreadPoolSingleton() {
+  ~ThreadPoolSingleton() override {
     stop();
   }
 };
@@ -86,7 +86,7 @@ struct C_FlushCache : public Context {
   C_FlushCache(ImageCtx *_image_ctx, Context *_on_safe)
     : image_ctx(_image_ctx), on_safe(_on_safe) {
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     // successful cache flush indicates all IO is now safe
     image_ctx->flush_cache(on_safe);
   }
@@ -99,7 +99,7 @@ struct C_ShutDownCache : public Context {
   C_ShutDownCache(ImageCtx *_image_ctx, Context *_on_finish)
     : image_ctx(_image_ctx), on_finish(_on_finish) {
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     image_ctx->object_cacher->stop();
     on_finish->complete(r);
   }
@@ -116,7 +116,7 @@ struct C_InvalidateCache : public Context {
     : image_ctx(_image_ctx), purge_on_error(_purge_on_error),
       reentrant_safe(_reentrant_safe), on_finish(_on_finish) {
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     assert(image_ctx->cache_lock.is_locked());
     CephContext *cct = image_ctx->cct;
 
index e1ba4a312dc6333a8dc2187ea428142af8bcc21a..dfac0c5b95bb7cb079bddcacd0a1b6e6a7c4e7c8 100644 (file)
@@ -194,7 +194,7 @@ private:
                   1) {
       start();
     }
-    virtual ~ThreadPoolSingleton() {
+    ~ThreadPoolSingleton() override {
       stop();
     }
   };
index 096820d21a9cbcb164d6d275a308db2aae2e1fc3..ec0d7cb5125e525da5b7537cdb1fac2238174129 100644 (file)
@@ -46,7 +46,7 @@ public:
     : ThreadPool(cct, "librbd::Journal", "tp_librbd_journ", 1) {
     start();
   }
-  virtual ~ThreadPoolSingleton() {
+  ~ThreadPoolSingleton() override {
     stop();
   }
 };
@@ -75,7 +75,7 @@ struct C_IsTagOwner : public Context {
                               {})) {
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     ldout(cct, 20) << this << " C_IsTagOwner::" << __func__ << ": r=" << r
                   << dendl;
     if (r < 0) {
@@ -1738,11 +1738,11 @@ struct C_RefreshTags : public Context {
       lock("librbd::Journal::C_RefreshTags::lock") {
     async_op_tracker.start_op();
   }
-  virtual ~C_RefreshTags() {
+  ~C_RefreshTags() override {
      async_op_tracker.finish_op();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     on_finish->complete(r);
   }
 };
index 5485ba5d62c51e1dffcd3566f0a071cb6a1a388e..bda734ca948ea5a9ae8c1018bc039bbc685b86a7 100644 (file)
@@ -23,7 +23,7 @@ class FlushCacheCommand : public LibrbdAdminSocketCommand {
 public:
   explicit FlushCacheCommand(ImageCtx *ictx) : ictx(ictx) {}
 
-  bool call(stringstream *ss) {
+  bool call(stringstream *ss) override {
     int r = flush(ictx);
     if (r < 0) {
       *ss << "flush: " << cpp_strerror(r);
@@ -40,7 +40,7 @@ struct InvalidateCacheCommand : public LibrbdAdminSocketCommand {
 public:
   explicit InvalidateCacheCommand(ImageCtx *ictx) : ictx(ictx) {}
 
-  bool call(stringstream *ss) {
+  bool call(stringstream *ss) override {
     int r = invalidate_cache(ictx);
     if (r < 0) {
       *ss << "invalidate_cache: " << cpp_strerror(r);
index 8a6244d79f545c406c0ac02472f7258c453251f4..b1e3826df4d34b263afa379d8c03e8fc26dcf057 100644 (file)
@@ -53,7 +53,7 @@ namespace librbd {
     C_ReadRequest(CephContext *cct, Context *c, Mutex *cache_lock)
       : m_cct(cct), m_ctx(c), m_cache_lock(cache_lock) {
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       ldout(m_cct, 20) << "aio_cb completing " << dendl;
       {
         Mutex::Locker cache_locker(*m_cache_lock);
@@ -72,8 +72,8 @@ namespace librbd {
     C_OrderedWrite(CephContext *cct, LibrbdWriteback::write_result_d *result,
                   LibrbdWriteback *wb)
       : m_cct(cct), m_result(result), m_wb_handler(wb) {}
-    virtual ~C_OrderedWrite() {}
-    virtual void finish(int r) {
+    ~C_OrderedWrite() override {}
+    void finish(int r) override {
       ldout(m_cct, 20) << "C_OrderedWrite completing " << m_result << dendl;
       {
        Mutex::Locker l(m_wb_handler->m_lock);
@@ -116,7 +116,7 @@ namespace librbd {
                      << journal_tid << " safe" << dendl;
     }
 
-    virtual void complete(int r) {
+    void complete(int r) override {
       if (request_sent || r < 0) {
         if (request_sent && r == 0) {
           // only commit IO events that are safely recorded to the backing image
@@ -131,7 +131,7 @@ namespace librbd {
       }
     }
 
-    virtual void finish(int r) {
+    void finish(int r) override {
     }
 
     void commit_io_event_extent(int r) {
@@ -179,7 +179,7 @@ namespace librbd {
         length(length) {
     }
 
-    virtual void finish(int r) {
+    void finish(int r) override {
       // all IO operations are flushed prior to closing the journal
       assert(image_ctx->journal != nullptr);
 
index 4325d620730d3a6e531791f850e3d8a33b23177f..76594d3c0fdb378dc1136ebbdaea98dead98aa8f 100644 (file)
@@ -33,7 +33,7 @@ struct C_SendLockRequest : public Context {
   R* request;
   explicit C_SendLockRequest(R* request) : request(request) {
   }
-  virtual void finish(int r) override {
+  void finish(int r) override {
     request->send();
   }
 };
@@ -45,10 +45,10 @@ struct C_Tracked : public Context {
     : tracker(tracker), ctx(ctx) {
     tracker.start_op();
   }
-  virtual ~C_Tracked() {
+  ~C_Tracked() override {
     tracker.finish_op();
   }
-  virtual void finish(int r) override {
+  void finish(int r) override {
     ctx->complete(r);
   }
 };
index a3a828e0fa449acd94f24c9999e93878c9eba132..21581eabd5fce1b004d789dab2fb1344e78fcbf3 100644 (file)
@@ -53,7 +53,7 @@ struct C_NotifyUpdate : public Context {
     : image_ctx(image_ctx), on_finish(on_finish) {
   }
 
-  virtual void complete(int r) override {
+  void complete(int r) override {
     CephContext *cct = image_ctx.cct;
     if (notified) {
       if (r == -ETIMEDOUT) {
@@ -81,7 +81,7 @@ struct C_NotifyUpdate : public Context {
     notified = true;
     image_ctx.notify_update(this);
   }
-  virtual void finish(int r) override {
+  void finish(int r) override {
     on_finish->complete(r);
   }
 };
@@ -299,7 +299,7 @@ struct C_InvokeAsyncRequest : public Context {
     complete(r);
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
     if (filter_error_codes.count(r) != 0) {
       r = 0;
     }
index edf15d102d7c4fe43d6bdc19df7be64036cc9c77..49069574e98b5fb260c8b12281dd8bb13e6025ce 100644 (file)
@@ -34,7 +34,7 @@ struct C_UnwatchAndFlush : public Context {
     : rados(io_ctx), on_finish(on_finish) {
   }
 
-  virtual void complete(int r) override {
+  void complete(int r) override {
     if (ret_val == 0 && r < 0) {
       ret_val = r;
     }
@@ -59,7 +59,7 @@ struct C_UnwatchAndFlush : public Context {
     ctx->complete(r);
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
   }
 };
 
index 2ac4f4329d4003c4948b14cc6f5c09ed0287e3be..67dfbea5debe2d82849e6cc974f1fa162b11499b 100644 (file)
@@ -2055,7 +2055,7 @@ void filter_out_mirror_watchers(ImageCtx *ictx,
   public:
     C_CopyWrite(SimpleThrottle *throttle, bufferlist *bl)
       : m_throttle(throttle), m_bl(bl) {}
-    virtual void finish(int r) {
+    void finish(int r) override {
       delete m_bl;
       m_throttle->end_op(r);
     }
@@ -2071,7 +2071,7 @@ void filter_out_mirror_watchers(ImageCtx *ictx,
       : m_throttle(throttle), m_dest(dest), m_offset(offset), m_bl(bl) {
       m_throttle->start_op();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       if (r < 0) {
        lderr(m_dest->cct) << "error reading from source image at offset "
                           << m_offset << ": " << cpp_strerror(r) << dendl;
@@ -3341,7 +3341,7 @@ void filter_out_mirror_watchers(ImageCtx *ictx,
     uint64_t length;
     C_RBD_Readahead(ImageCtx *ictx, object_t oid, uint64_t offset, uint64_t length)
       : ictx(ictx), oid(oid), offset(offset), length(length) { }
-    void finish(int r) {
+    void finish(int r) override {
       ldout(ictx->cct, 20) << "C_RBD_Readahead on " << oid << ": " << offset << "+" << length << dendl;
       ictx->readahead.dec_pending();
     }
index ff52c50d0468d1c8f0254419cb3b7024d7a8e39b..413465b2382849d41f77065a3c488f7f822fb72a 100644 (file)
@@ -104,7 +104,7 @@ struct ExecuteOp : public Context {
     image_ctx.operations->execute_metadata_remove(event.key, on_op_complete);
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
     CephContext *cct = image_ctx.cct;
     if (r < 0) {
       lderr(cct) << ": ExecuteOp::" << __func__ << ": r=" << r << dendl;
@@ -126,11 +126,11 @@ struct C_RefreshIfRequired : public Context {
   C_RefreshIfRequired(I &image_ctx, Context *on_finish)
     : image_ctx(image_ctx), on_finish(on_finish) {
   }
-  virtual ~C_RefreshIfRequired() {
+  ~C_RefreshIfRequired() override {
     delete on_finish;
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
     CephContext *cct = image_ctx.cct;
     Context *ctx = on_finish;
     on_finish = nullptr;
index 5cac1226d308f96258fede16bd8cb6788e7ee60b..f9ac00300687073f6e9325cab5d799aa6f1f3490 100644 (file)
@@ -78,7 +78,7 @@ struct C_OpenComplete : public Context {
     comp->init_time(ictx, librbd::AIO_TYPE_OPEN);
     comp->get();
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     ldout(ictx->cct, 20) << "C_OpenComplete::finish: r=" << r << dendl;
     if (reopen) {
       delete reinterpret_cast<librbd::ImageCtx*>(*ictxp);
@@ -103,7 +103,7 @@ struct C_OpenAfterCloseComplete : public Context {
                           void **ictxp)
     : ictx(ictx), comp(comp), ictxp(ictxp) {
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     ldout(ictx->cct, 20) << "C_OpenAfterCloseComplete::finish: r=" << r
                         << dendl;
     ictx->state->open(false, new C_OpenComplete(ictx, comp, ictxp, true));
@@ -118,7 +118,7 @@ struct C_CloseComplete : public Context {
     comp->init_time(ictx, librbd::AIO_TYPE_CLOSE);
     comp->get();
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     ldout(cct, 20) << "C_CloseComplete::finish: r=" << r << dendl;
     if (r < 0) {
       comp->fail(r);
@@ -138,7 +138,7 @@ struct C_UpdateWatchCB : public librbd::UpdateWatchCtx {
   C_UpdateWatchCB(rbd_update_callback_t watch_cb, void *arg) :
     watch_cb(watch_cb), arg(arg) {
   }
-  void handle_notify() {
+  void handle_notify() override {
     watch_cb(arg);
   }
 };
@@ -187,7 +187,7 @@ namespace librbd {
       : m_fn(fn), m_data(data)
     {
     }
-    int update_progress(uint64_t offset, uint64_t src_size)
+    int update_progress(uint64_t offset, uint64_t src_size) override
     {
       return m_fn(offset, src_size, m_data);
     }
index bf66d932c4b35ae83be65e48e80115c01d55172d..482408d7f884161297355b6f740c554123c7e37c 100644 (file)
@@ -37,7 +37,7 @@ struct C_BlacklistClient : public Context {
       expire_seconds(expire_seconds), on_finish(on_finish) {
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
     librados::Rados rados(ioctx);
     r = rados.blacklist_add(locker_address, expire_seconds);
     on_finish->complete(r);
index 911534dea2ca8b6f14458b3fdbba75268d794a91..70d358ab3c046799083de70eebd651df12764cd5 100644 (file)
@@ -28,7 +28,7 @@ public:
   {
   }
 
-  virtual int send() {
+  int send() override {
     I &image_ctx = this->m_image_ctx;
     assert(image_ctx.owner_lock.is_locked());
     CephContext *cct = image_ctx.cct;
index 229a585d2a0789169e9bd035ddcfcbf131a387ec..2b1fa74e6aca73b9aa62d9edd0c9281f879bfcc1 100644 (file)
@@ -42,7 +42,7 @@ public:
     m_io_ctx.snap_set_read(CEPH_SNAPDIR);
   }
 
-  virtual void complete(int r) {
+  void complete(int r) override {
     I &image_ctx = this->m_image_ctx;
     if (should_complete(r)) {
       ldout(image_ctx.cct, 20) << m_oid << " C_VerifyObjectCallback completed "
@@ -52,7 +52,7 @@ public:
     }
   }
 
-  virtual int send() {
+  int send() override {
     send_list_snaps();
     return 0;
   }
index 4129544103dc74f77ef3a54a682bda5617993011..a12edfd4e10f89f6ac9bbe75e8083a03d9e5050b 100644 (file)
@@ -36,7 +36,7 @@ public:
       m_object_num(object_num) {
   }
 
-  virtual int send() {
+  int send() override {
     I &image_ctx = this->m_image_ctx;
     CephContext *cct = image_ctx.cct;
     ldout(cct, 20) << "C_RollbackObject: " << __func__ << ": object_num="
index 0b7b7c4382b3148f3c0ad72f92d9be57ef9d94c6..6375782c3bbd7cec1e42a5e642bd7ff40435693a 100644 (file)
@@ -62,7 +62,7 @@ public:
       m_pool(pools[pool_idx]) {
   }
 
-  virtual int send() {
+  int send() override {
     I &image_ctx = this->m_image_ctx;
     assert(image_ctx.owner_lock.is_locked());
 
@@ -111,7 +111,7 @@ public:
   }
 
 protected:
-  virtual void finish(int r) {
+  void finish(int r) override {
     I &image_ctx = this->m_image_ctx;
     CephContext *cct = image_ctx.cct;
 
index 5e3500779df5f024b56227cd72bbf74284ca257f..b3a30883e166a5886f8c9a5f350414bab7601ca1 100644 (file)
@@ -36,7 +36,7 @@ public:
   {
   }
 
-  virtual int send() {
+  int send() override {
     I &image_ctx = this->m_image_ctx;
     assert(image_ctx.owner_lock.is_locked());
     assert(image_ctx.exclusive_lock == nullptr ||
@@ -64,7 +64,7 @@ public:
   {
   }
 
-  virtual int send() {
+  int send() override {
     I &image_ctx = this->m_image_ctx;
     assert(image_ctx.owner_lock.is_locked());
     assert(image_ctx.exclusive_lock == nullptr ||
index 837e947743c0d92110708e462c9887ba50b130b4..c9745f3380defd26c8779ae6b7c59244c461bdfa 100644 (file)
@@ -1645,12 +1645,12 @@ TEST_F(TestClsRbd, mirror_image_status) {
     librados::IoCtx *m_ioctx;
 
     WatchCtx(librados::IoCtx *ioctx) : m_ioctx(ioctx) {}
-    virtual void handle_notify(uint64_t notify_id, uint64_t cookie,
-                            uint64_t notifier_id, bufferlist& bl_) {
+    void handle_notify(uint64_t notify_id, uint64_t cookie,
+                            uint64_t notifier_id, bufferlist& bl_) override {
       bufferlist bl;
       m_ioctx->notify_ack(RBD_MIRRORING, notify_id, cookie, bl);
     }
-    virtual void handle_error(uint64_t cookie, int err) {}
+    void handle_error(uint64_t cookie, int err) override {}
   };
 
   map<std::string, cls::rbd::MirrorImage> images;
index 5666d9305e8e3d7d1378a5d684975bb6111c1b48..d2a221f6da52ceba11446dfbcf940f1b3c787b1e 100644 (file)
@@ -272,12 +272,12 @@ struct ReplayHandler : public journal::ReplayHandler {
                   on_finish(on_finish) {
         }
 
-        virtual void get() {
+        void get() override {
         }
-        virtual void put() {
+        void put() override {
         }
 
-        virtual void handle_entries_available() {
+        void handle_entries_available() override {
                 while (true) {
                         journal::ReplayEntry replay_entry;
                         if (!journaler->try_pop_front(&replay_entry)) {
@@ -288,7 +288,7 @@ struct ReplayHandler : public journal::ReplayHandler {
                 }
         }
 
-        virtual void handle_complete(int r) {
+        void handle_complete(int r) override {
                 on_finish->complete(r);
         }
 };
index 6ceb4d1547dbf72b7f34ac220f0e40d22a17868b..21fd17c594ca8380e6dad99b09813311cf02fb74 100644 (file)
@@ -32,18 +32,18 @@ public:
       : lock("ReplayHandler::lock"), entries_available(false), complete(false) {
     }
 
-    virtual void get() {
+    void get() override {
     }
-    virtual void put() {
+    void put() override {
     }
 
-    virtual void handle_entries_available()  {
+    void handle_entries_available() override  {
       Mutex::Locker locker(lock);
       entries_available = true;
       cond.Signal();
     }
 
-    virtual void handle_complete(int r) {
+    void handle_complete(int r) override {
       Mutex::Locker locker(lock);
       complete = true;
       cond.Signal();
@@ -53,7 +53,7 @@ public:
   ReplayHandler m_replay_handler;
   Journalers m_journalers;
 
-  virtual void TearDown() {
+  void TearDown() override {
     for (Journalers::iterator it = m_journalers.begin();
          it != m_journalers.end(); ++it) {
       journal::Journaler *journaler = *it;
index b16188b04a47425a77002f45a1fa99b399b7cb17..e41e58825494bb202fa82e1dce25d5e77b259069 100644 (file)
@@ -33,7 +33,7 @@ public:
 
   typedef BlockGuard<Operation> OpBlockGuard;
 
-  virtual void SetUp() override {
+  void SetUp() override {
     TestFixture::SetUp();
     m_cct = reinterpret_cast<CephContext*>(m_ioctx.cct());
   }
index 605da612f9d8b769871226eeef59e6bc1aed9cdd..740d030a618ce715bd0895f1bdf2ffdeec50fa5f 100644 (file)
@@ -58,10 +58,10 @@ public:
       return m_parent.m_ioctx.unwatch2(m_handle);
     }
 
-    virtual void handle_notify(uint64_t notify_id,
+    void handle_notify(uint64_t notify_id,
                                uint64_t cookie,
                                uint64_t notifier_id,
-                               bufferlist& bl) {
+                               bufferlist& bl) override {
       try {
        int op;
        bufferlist payload;
@@ -93,7 +93,7 @@ public:
       }
     }
 
-    virtual void handle_error(uint64_t cookie, int err) {
+    void handle_error(uint64_t cookie, int err) override {
       std::cerr << "ERROR: " << cookie << ", " << cpp_strerror(err)
                << std::endl; 
     }
@@ -108,7 +108,7 @@ public:
     uint64_t m_handle;
   };
 
-  virtual void TearDown() {
+  void TearDown() override {
     deregister_image_watch();
     TestFixture::TearDown();
   }
@@ -226,7 +226,7 @@ struct ProgressContext : public librbd::ProgressContext {
   ProgressContext() : mutex("ProgressContext::mutex"), received(false),
                       offset(0), total(0) {}
 
-  virtual int update_progress(uint64_t offset_, uint64_t total_) {
+  int update_progress(uint64_t offset_, uint64_t total_) override {
     Mutex::Locker l(mutex);
     offset = offset_;
     total = total_;
index 96756b8398c4f4e1b49740a18ff3e3a8b6c76fc3..c1365a5e0f5a37071e34443a9db2f0a4d8830de8 100644 (file)
@@ -39,7 +39,7 @@ using ::testing::WithArg;
 
 class TestMirroringWatcher : public TestFixture {
 public:
-  virtual void SetUp() {
+  void SetUp() override {
     TestFixture::SetUp();
 
     bufferlist bl;
@@ -58,7 +58,7 @@ public:
     }
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     if (m_image_watcher != nullptr) {
       C_SaferCond ctx;
       m_image_watcher->unregister_watch(&ctx);
index 182886325230efd0c90c1d93e37c3881ca093c34..fc192959773eba17a04c49959a26b5ead329ee21 100644 (file)
@@ -27,7 +27,7 @@ public:
 
   typedef std::vector<std::pair<std::string, bool> > Snaps;
 
-  virtual void TearDown() {
+  void TearDown() override {
     unlock_image();
     for (Snaps::iterator iter = m_snaps.begin(); iter != m_snaps.end(); ++iter) {
       librbd::ImageCtx *ictx;
@@ -69,7 +69,7 @@ public:
 
 class DummyContext : public Context {
 public:
-  virtual void finish(int r) {
+  void finish(int r) override {
   }
 };
 
index adee4e6483ba6c353159157b58c287c7ec0b577c..89d0942ab866cfb11375b8a4c2dbe9463c871a31 100644 (file)
@@ -179,7 +179,7 @@ public:
     }
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     ASSERT_NE("", m_pool_name = create_pool());
   }
 
@@ -686,7 +686,7 @@ TEST_F(TestLibRBD, UpdateWatchAndResizePP)
     struct Watcher : public librbd::UpdateWatchCtx {
       Watcher(librbd::Image &image) : m_image(image), m_lock("lock") {
       }
-      void handle_notify() {
+      void handle_notify() override {
         librbd::image_info_t info;
        ASSERT_EQ(0, m_image.stat(info, sizeof(info)));
         Mutex::Locker locker(m_lock);
@@ -887,7 +887,7 @@ TEST_F(TestLibRBD, TestCopy)
 class PrintProgress : public librbd::ProgressContext
 {
 public:
-  int update_progress(uint64_t offset, uint64_t src_size)
+  int update_progress(uint64_t offset, uint64_t src_size) override
   {
     float percent = ((float)offset * 100) / src_size;
     printf("%3.2f%% done\n", percent);
@@ -4033,7 +4033,7 @@ class RBDWriter : public Thread {
  public:
    explicit RBDWriter(librbd::Image &image) : m_image(image) {};
  protected:
-  void *entry() {
+  void *entry() override {
     librbd::image_info_t info;
     int r = m_image.stat(info, sizeof(info));
     assert(r == 0);
@@ -5137,7 +5137,7 @@ TEST_F(TestLibRBD, ExclusiveLock)
   };
 
   protected:
-    void *entry() {
+    void *entry() override {
       for (int i = 0; i < 10; i++) {
        {
          Mutex::Locker locker(m_lock);
index 244bb9247fcec49021e5861d5fb9381299f1b0ec..b2c0cff5ae53be1680f2f55169a41a3a66705f56 100644 (file)
@@ -39,13 +39,13 @@ public:
   TestMirroring() {}
 
 
-  virtual void TearDown() {
+  void TearDown() override {
     unlock_image();
 
     TestFixture::TearDown();
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     ASSERT_EQ(0, _rados.ioctx_create(_pool_name.c_str(), m_ioctx));
   }
 
@@ -662,13 +662,13 @@ TEST_F(TestMirroring, RemoveBootstrapped)
   struct MirrorWatcher : public librados::WatchCtx2 {
     MirrorWatcher(librados::IoCtx &ioctx) : m_ioctx(ioctx) {
     }
-    virtual void handle_notify(uint64_t notify_id, uint64_t cookie,
-                               uint64_t notifier_id, bufferlist& bl) {
+    void handle_notify(uint64_t notify_id, uint64_t cookie,
+                               uint64_t notifier_id, bufferlist& bl) override {
       // received IMAGE_UPDATED notification from remove
       m_notified = true;
       m_ioctx.notify_ack(RBD_MIRRORING, notify_id, cookie, bl);
     }
-    virtual void handle_error(uint64_t cookie, int err) {
+    void handle_error(uint64_t cookie, int err) override {
     }
     librados::IoCtx &m_ioctx;
     bool m_notified = false;
index a95fb5fb4618dcb2d5fe4f7fa820890d13fc3b9f..04847e0fe03e6fe87ca8f72c3edd69d26d09b5b6 100644 (file)
@@ -234,7 +234,7 @@ public:
   TestMockJournal() : m_lock("lock") {
   }
 
-  ~TestMockJournal() {
+  ~TestMockJournal() override {
     assert(m_commit_contexts.empty());
   }
 
@@ -250,7 +250,7 @@ public:
                    const ReplayAction &replay_action)
       : replay_handler(replay_handler), replay_action(replay_action) {
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       if (replay_action) {
         replay_action(*replay_handler);
       }
@@ -1239,13 +1239,13 @@ TEST_F(TestMockJournal, CloseListenerEvent) {
 
   struct Listener : public journal::Listener {
     C_SaferCond ctx;
-    virtual void handle_close() {
+    void handle_close() override {
       ctx.complete(0);
     }
-    virtual void handle_resync() {
+    void handle_resync() override {
       ADD_FAILURE() << "unexpected resync request";
     }
-    virtual void handle_promoted() {
+    void handle_promoted() override {
       ADD_FAILURE() << "unexpected promotion event";
     }
   } listener;
@@ -1273,13 +1273,13 @@ TEST_F(TestMockJournal, ResyncRequested) {
 
   struct Listener : public journal::Listener {
     C_SaferCond ctx;
-    virtual void handle_close() {
+    void handle_close() override {
       ADD_FAILURE() << "unexpected close action";
     }
-    virtual void handle_resync() {
+    void handle_resync() override {
       ctx.complete(0);
     }
-    virtual void handle_promoted() {
+    void handle_promoted() override {
       ADD_FAILURE() << "unexpected promotion event";
     }
   } listener;
@@ -1325,13 +1325,13 @@ TEST_F(TestMockJournal, ForcePromoted) {
 
   struct Listener : public journal::Listener {
     C_SaferCond ctx;
-    virtual void handle_close() {
+    void handle_close() override {
       ADD_FAILURE() << "unexpected close action";
     }
-    virtual void handle_resync() {
+    void handle_resync() override {
       ADD_FAILURE() << "unexpected resync event";
     }
-    virtual void handle_promoted() {
+    void handle_promoted() override {
       ctx.complete(0);
     }
   } listener;
index 1070df30618ae190fc97252c637bf5d9a895bf02..3b42b0e992491ac8ba857f7f6fa026d11af51656 100644 (file)
@@ -57,11 +57,11 @@ struct TestMockWatcherRewatchRequest : public TestMockFixture {
   }
 
   struct WatchCtx : public librados::WatchCtx2 {
-    virtual void handle_notify(uint64_t, uint64_t, uint64_t,
-                               ceph::bufferlist&) {
+    void handle_notify(uint64_t, uint64_t, uint64_t,
+                               ceph::bufferlist&) override {
       assert(false);
     }
-    virtual void handle_error(uint64_t, int) {
+    void handle_error(uint64_t, int) override {
       assert(false);
     }
   };
index 9acb0f0ed8a1cfc03615f794403e1afe8382b125..c6dee1859325fa6e03583a3209176b25f78240bb 100644 (file)
@@ -284,7 +284,7 @@ public:
   typedef OpenLocalImageRequest<librbd::MockTestImageCtx> MockOpenLocalImageRequest;
   typedef std::list<cls::journal::Tag> Tags;
 
-  void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index d18fade118318db97182085a28026ab54ad6d8ad..297fd6bf7adf76d6e70995b32c2441baa1df85a4 100644 (file)
@@ -205,7 +205,7 @@ public:
   typedef OpenImageRequest<librbd::MockTestImageCtx> MockOpenImageRequest;
   typedef CloseImageRequest<librbd::MockTestImageCtx> MockCloseImageRequest;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index 0ef282003b6e0635d038c1a82d4e5507f1984de8..9929f2ad5866042fb372c99bcdd038df12c52939 100644 (file)
@@ -46,7 +46,7 @@ class TestMockImageReplayerEventPreprocessor : public TestMockFixture {
 public:
   typedef EventPreprocessor<librbd::MockTestImageCtx> MockEventPreprocessor;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index 5ab67ca19f904e0920bedcfe1246f43a6c445a5f..a36f0bb10f2c76bb03c82f12a3b58cc8ac217ac5 100644 (file)
@@ -95,7 +95,7 @@ public:
   typedef ImageCopyRequest<librbd::MockTestImageCtx> MockImageCopyRequest;
   typedef ObjectCopyRequest<librbd::MockTestImageCtx> MockObjectCopyRequest;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index 5b3006994fd7230f2505895059b300784cfa8fa0..e1177bf0680027e85f8bf4e5b6c397b3150806ab 100644 (file)
@@ -71,7 +71,7 @@ class TestMockImageSyncObjectCopyRequest : public TestMockFixture {
 public:
   typedef ObjectCopyRequest<librbd::MockTestImageCtx> MockObjectCopyRequest;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index a962f5a8e80a409ba38b99b96b930c6a71fd920d..5b2ca67d1108ec74c19a57b302b1c79a89c6737c 100644 (file)
@@ -94,7 +94,7 @@ public:
   typedef SnapshotCopyRequest<librbd::MockTestImageCtx> MockSnapshotCopyRequest;
   typedef SnapshotCreateRequest<librbd::MockTestImageCtx> MockSnapshotCreateRequest;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index f664ed599a119580af0c663e53b762a662b93664..b395b3e77636cfd944ebf3e5f26c4b1df19a2c12 100644 (file)
@@ -46,7 +46,7 @@ class TestMockImageSyncSnapshotCreateRequest : public TestMockFixture {
 public:
   typedef SnapshotCreateRequest<librbd::MockTestImageCtx> MockSnapshotCreateRequest;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index 0dfe10e4b02e044709446c8ff9e25200c77e0d92..c9c3316bfa56245ad4145aafa93744a51867376a 100644 (file)
@@ -48,7 +48,7 @@ class TestMockImageSyncSyncPointCreateRequest : public TestMockFixture {
 public:
   typedef SyncPointCreateRequest<librbd::MockTestImageCtx> MockSyncPointCreateRequest;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index 7d037654640b88f79e51c1a1544cc90133a3d546..4bec0f94e493ed6ad1a0ac5639e7bf74dcff0f24 100644 (file)
@@ -50,7 +50,7 @@ class TestMockImageSyncSyncPointPruneRequest : public TestMockFixture {
 public:
   typedef SyncPointPruneRequest<librbd::MockTestImageCtx> MockSyncPointPruneRequest;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index 88ca29cebc5b6b1679c712a4d20a7a5acdd73d4c..e57ac7e0ab13f6c8e930dfbd5e63316a306f7a59 100644 (file)
@@ -58,7 +58,7 @@ public:
     m_local_pool_id = _rados->pool_lookup(_local_pool_name.c_str());
   }
 
-  void SetUp() {
+  void SetUp() override {
     TestFixture::SetUp();
 
     librbd::mirror_mode_set(m_local_io_ctx, RBD_MIRROR_MODE_IMAGE);
@@ -82,7 +82,7 @@ public:
     EXPECT_EQ(0, ictx->state->close());
   }
 
-  void TearDown() {
+  void TearDown() override {
     remove_image();
     TestFixture::TearDown();
     delete m_deleter;
index e4231f75cc06fc9fdc0d9ad3f85c3899e2bdd96e..29d56dd64eaaa31b93a2b0f238a7ba406b6d980c 100644 (file)
@@ -62,8 +62,8 @@ public:
       : test(test), oid(oid), lock("C_WatchCtx::lock"), notified(false) {
     }
 
-    virtual void handle_notify(uint64_t notify_id, uint64_t cookie,
-                               uint64_t notifier_id, bufferlist& bl_) {
+    void handle_notify(uint64_t notify_id, uint64_t cookie,
+                               uint64_t notifier_id, bufferlist& bl_) override {
       bufferlist bl;
       test->m_remote_ioctx.notify_ack(oid, notify_id, cookie, bl);
 
@@ -72,7 +72,7 @@ public:
       cond.Signal();
     }
 
-    virtual void handle_error(uint64_t cookie, int err) {
+    void handle_error(uint64_t cookie, int err) override {
       ASSERT_EQ(0, err);
     }
   };
@@ -118,7 +118,7 @@ public:
     m_image_sync_throttler.reset(new rbd::mirror::ImageSyncThrottler<>());
   }
 
-  ~TestImageReplayer()
+  ~TestImageReplayer() override 
   {
     unwatch();
 
index e5de1065270f002ad1effd562d217d2072660a74..2b79e6ba2da77efccd19a22566f215b590a9a6c2 100644 (file)
@@ -48,7 +48,7 @@ void scribble(librbd::ImageCtx *image_ctx, int num_ops, size_t max_size)
 class TestImageSync : public TestFixture {
 public:
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestFixture::SetUp();
     create_and_open(m_local_io_ctx, &m_local_image_ctx);
     create_and_open(m_remote_io_ctx, &m_remote_image_ctx);
@@ -66,7 +66,7 @@ public:
     ASSERT_EQ(0, m_remote_journaler->register_client(client_data_bl));
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     TestFixture::TearDown();
     delete m_remote_journaler;
   }
index 6d0533f3797f18ebfd190aec6550f8d3d28bd640..a77ebd4ba2264be31487360514b8a076f5d6250c 100644 (file)
@@ -47,7 +47,7 @@ public:
       return m_release_count;
     }
 
-    virtual void post_acquire_handler(Context *on_finish) {
+    void post_acquire_handler(Context *on_finish) override {
       Mutex::Locker locker(m_test_lock);
       m_acquire_count++;
       on_finish->complete(m_on_acquire_r);
@@ -58,7 +58,7 @@ public:
       }
     }
 
-    virtual void pre_release_handler(Context *on_finish) {
+    void pre_release_handler(Context *on_finish) override {
       Mutex::Locker locker(m_test_lock);
       m_release_count++;
       on_finish->complete(m_on_release_r);
@@ -86,7 +86,7 @@ public:
 
   std::list<std::unique_ptr<Connection> > m_connections;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestFixture::SetUp();
     EXPECT_EQ(0, librbd::mirror_mode_set(m_local_io_ctx, RBD_MIRROR_MODE_POOL));
 
index 3503b76be0ef447603a1b4a11d06ed90120a2ba9..5b717c5b5fe3ec5a25625bfd5d08b62bfe63f060 100644 (file)
@@ -249,7 +249,7 @@ public:
   typedef librbd::journal::Replay<librbd::MockTestImageCtx> MockReplay;
   typedef ImageReplayer<librbd::MockTestImageCtx> MockImageReplayer;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
@@ -270,7 +270,7 @@ public:
       m_remote_io_ctx.get_id(), m_remote_image_ctx->id, "global image id");
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     delete m_image_replayer;
 
     TestMockFixture::TearDown();
index 9fbc76075387ffca28b27f2d9bb26323a7202f1d..921525d735eb342057d404761911e188074090d7 100644 (file)
@@ -180,7 +180,7 @@ public:
   typedef image_sync::SyncPointCreateRequest<librbd::MockTestImageCtx> MockSyncPointCreateRequest;
   typedef image_sync::SyncPointPruneRequest<librbd::MockTestImageCtx> MockSyncPointPruneRequest;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
index 252cbba27de1e506a2e0e2fc4cacecc15472f216..2ce53f32bace9fe0048f6de2438646a35d028b35 100644 (file)
@@ -109,7 +109,7 @@ class TestMockImageSyncThrottler : public TestMockFixture {
 public:
   typedef ImageSyncThrottler<librbd::MockTestImageCtx> MockImageSyncThrottler;
 
-  virtual void SetUp() {
+  void SetUp() override {
     TestMockFixture::SetUp();
 
     librbd::RBD rbd;
@@ -126,7 +126,7 @@ public:
     m_mock_journaler = new journal::MockJournaler();
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     MockImageSync::instances.clear();
     delete mock_sync_throttler;
     delete m_mock_local_image_ctx;
index 6d50413b6d1adff0e2d03131238dc135937a3679..a0f0ddbf6bca7d6bca9230f8c6a2626a801c2620 100644 (file)
@@ -46,7 +46,7 @@ public:
     }
   }
 
-  virtual void finish(int r)
+  void finish(int r) override
   {
     BOOST_SCOPE_EXIT((&m_throttle) (&r))
     {
index 13e7346cf3fe3d6f2c20c4032ce290a3a0f4974c..df74eab32d3868af1a2e9220736c9e35aa12309f 100644 (file)
@@ -74,7 +74,7 @@ public:
   }
 
 protected:
-  virtual void finish(int r) {
+  void finish(int r) override {
     if (r >= 0) {
       if (m_exists) {
         m_exists = !m_read_data.is_zero();
index 4fd9a36eef565eb452be125f78b9c16c48dd729f..2d721846cb6d13ef49549f250affc15b854ec355 100644 (file)
@@ -46,7 +46,7 @@ public:
     }
   }
 
-  virtual void finish(int r)
+  void finish(int r) override
   {
     if (r < 0) {
       std::cerr << "rbd: error writing to destination image at offset "
index 0e3e6b3d62cc90f23f238de495165aac05592198..3485dc1f975a5da68517c615549b6a5f2250483f 100644 (file)
@@ -317,13 +317,13 @@ protected:
     JournalPlayer *journal;
     explicit ReplayHandler(JournalPlayer *_journal) : journal(_journal) {}
 
-    virtual void get() {}
-    virtual void put() {}
+    void get() override {}
+    void put() override {}
 
-    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);
     }
   };
@@ -388,7 +388,7 @@ public:
     m_s() {
   }
 
-  int exec() {
+  int exec() override {
     int r = JournalPlayer::exec();
     m_s.print();
     return r;
@@ -409,7 +409,7 @@ private:
   };
 
   int process_entry(::journal::ReplayEntry replay_entry,
-                   uint64_t tag_id) {
+                   uint64_t tag_id) override {
     m_s.total++;
     if (m_verbose) {
       std::cout << "Entry: tag_id=" << tag_id << ", commit_tid="
@@ -486,7 +486,7 @@ public:
     m_s() {
   }
 
-  int exec() {
+  int exec() override {
     std::string header("# journal_id: " + m_journal_id + "\n");
     int r;
     r = safe_write(m_fd, header.c_str(), header.size());
@@ -514,7 +514,7 @@ private:
   };
 
   int process_entry(::journal::ReplayEntry replay_entry,
-                   uint64_t tag_id) {
+                   uint64_t tag_id) override {
     m_s.total++;
     int type = -1;
     bufferlist entry = replay_entry.get_data();
index 80caeeee463b63ff33889afce73939de355ccd0f..741dc10ecdc6164574e121c8355e5c942e48a200 100644 (file)
@@ -24,12 +24,12 @@ public:
   {
   }
 
-  virtual ~RbdWatchCtx() {}
+  ~RbdWatchCtx() override {}
 
-  virtual void handle_notify(uint64_t notify_id,
+  void handle_notify(uint64_t notify_id,
                              uint64_t cookie,
                              uint64_t notifier_id,
-                             bufferlist& bl) {
+                             bufferlist& bl) override {
     std::cout << m_image_name << " received notification: notify_id="
               << notify_id << ", cookie=" << cookie << ", notifier_id="
               << notifier_id << ", bl.length=" << bl.length() << std::endl;
@@ -37,7 +37,7 @@ public:
     m_io_ctx.notify_ack(m_header_oid, notify_id, cookie, reply);
   }
 
-  virtual void handle_error(uint64_t cookie, int err) {
+  void handle_error(uint64_t cookie, int err) override {
     std::cerr << m_image_name << " received error: cookie=" << cookie << ", "
               << "err=" << cpp_strerror(err) << std::endl;
   }
index 39bf57dd813fa3f6f27c6ffec3dab769ed229979..39f85ae7b34df75dc46d00265a75a905b175ab06 100644 (file)
@@ -65,7 +65,7 @@ class StatusCommand : public ImageDeleterAdminSocketCommand {
 public:
   explicit StatusCommand(ImageDeleter *image_del) : image_del(image_del) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     image_del->print_status(f, ss);
     return true;
   }
@@ -75,14 +75,14 @@ private:
 };
 
 struct DeleteJournalPolicy : public librbd::journal::Policy {
-  virtual bool append_disabled() const {
+  bool append_disabled() const override {
     return true;
   }
-  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 {
     on_finish->complete(0);
   }
 };
@@ -106,7 +106,7 @@ public:
 
   }
 
-  ~ImageDeleterAdminSocketHook() {
+  ~ImageDeleterAdminSocketHook() override {
     for (Commands::const_iterator i = commands.begin(); i != commands.end();
         ++i) {
       (void)admin_socket->unregister_command(i->first);
@@ -115,7 +115,7 @@ public:
   }
 
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
-           bufferlist& out) {
+           bufferlist& out) override {
     Commands::const_iterator i = commands.find(command);
     assert(i != commands.end());
     Formatter *f = Formatter::create(format);
index 132db547da95dbbe2d966c600322e58e0ea6e524..b0f2a553c5cf99e11e1ce6edd56104bda91fdb8d 100644 (file)
@@ -57,13 +57,13 @@ template <typename I>
 struct ReplayHandler : public ::journal::ReplayHandler {
   ImageReplayer<I> *replayer;
   ReplayHandler(ImageReplayer<I> *replayer) : replayer(replayer) {}
-  virtual void get() {}
-  virtual void put() {}
+  void get() override {}
+  void put() override {}
 
-  virtual void handle_entries_available() {
+  void handle_entries_available() override {
     replayer->handle_replay_ready();
   }
-  virtual void handle_complete(int r) {
+  void handle_complete(int r) override {
     std::stringstream ss;
     if (r < 0) {
       ss << "replay completed with error: " << cpp_strerror(r);
@@ -83,7 +83,7 @@ class StatusCommand : public ImageReplayerAdminSocketCommand {
 public:
   explicit StatusCommand(ImageReplayer<I> *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->print_status(f, ss);
     return true;
   }
@@ -97,7 +97,7 @@ class StartCommand : public ImageReplayerAdminSocketCommand {
 public:
   explicit StartCommand(ImageReplayer<I> *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->start(nullptr, true);
     return true;
   }
@@ -111,7 +111,7 @@ class StopCommand : public ImageReplayerAdminSocketCommand {
 public:
   explicit StopCommand(ImageReplayer<I> *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->stop(nullptr, true);
     return true;
   }
@@ -125,7 +125,7 @@ class RestartCommand : public ImageReplayerAdminSocketCommand {
 public:
   explicit RestartCommand(ImageReplayer<I> *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->restart();
     return true;
   }
@@ -139,7 +139,7 @@ class FlushCommand : public ImageReplayerAdminSocketCommand {
 public:
   explicit FlushCommand(ImageReplayer<I> *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     C_SaferCond cond;
     replayer->flush(&cond);
     int r = cond.wait();
@@ -199,7 +199,7 @@ public:
     }
   }
 
-  ~ImageReplayerAdminSocketHook() {
+  ~ImageReplayerAdminSocketHook() override {
     for (Commands::const_iterator i = commands.begin(); i != commands.end();
         ++i) {
       (void)admin_socket->unregister_command(i->first);
@@ -208,7 +208,7 @@ public:
   }
 
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
-           bufferlist& out) {
+           bufferlist& out) override {
     Commands::const_iterator i = commands.find(command);
     assert(i != commands.end());
     Formatter *f = Formatter::create(format);
index f77a5c46b22839143e8ed9944389cf654f1aadbd..9d3123c15dfb85b6cd55abf8c3137cb1fd7b1e45 100644 (file)
@@ -41,7 +41,7 @@ struct ImageSyncThrottler<ImageCtxT>::C_SyncHolder : public Context {
       m_local_pool_image_id(local_pool_image_id), m_on_finish(on_finish) {
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     m_sync_throttler->handle_sync_finished(this);
     m_on_finish->complete(r);
   }
index e9ef90694f1b6cb3a850a11dac860c43e4485f9a..66d2f2e9c08fa37e478de71bdcfb034c51accdea 100644 (file)
@@ -43,7 +43,7 @@ class StatusCommand : public MirrorAdminSocketCommand {
 public:
   explicit StatusCommand(Mirror *mirror) : mirror(mirror) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     mirror->print_status(f, ss);
     return true;
   }
@@ -56,7 +56,7 @@ class StartCommand : public MirrorAdminSocketCommand {
 public:
   explicit StartCommand(Mirror *mirror) : mirror(mirror) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     mirror->start();
     return true;
   }
@@ -69,7 +69,7 @@ class StopCommand : public MirrorAdminSocketCommand {
 public:
   explicit StopCommand(Mirror *mirror) : mirror(mirror) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     mirror->stop();
     return true;
   }
@@ -82,7 +82,7 @@ class RestartCommand : public MirrorAdminSocketCommand {
 public:
   explicit RestartCommand(Mirror *mirror) : mirror(mirror) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     mirror->restart();
     return true;
   }
@@ -95,7 +95,7 @@ class FlushCommand : public MirrorAdminSocketCommand {
 public:
   explicit FlushCommand(Mirror *mirror) : mirror(mirror) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     mirror->flush();
     return true;
   }
@@ -108,7 +108,7 @@ class LeaderReleaseCommand : public MirrorAdminSocketCommand {
 public:
   explicit LeaderReleaseCommand(Mirror *mirror) : mirror(mirror) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     mirror->release_leader();
     return true;
   }
@@ -169,7 +169,7 @@ public:
     }
   }
 
-  ~MirrorAdminSocketHook() {
+  ~MirrorAdminSocketHook() override {
     for (Commands::const_iterator i = commands.begin(); i != commands.end();
         ++i) {
       (void)admin_socket->unregister_command(i->first);
@@ -178,7 +178,7 @@ public:
   }
 
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
-           bufferlist& out) {
+           bufferlist& out) override {
     Commands::const_iterator i = commands.find(command);
     assert(i != commands.end());
     Formatter *f = Formatter::create(format);
index 2da5d86bfe6fdd46dbc688e853848e7967e1a6f6..f58e6188668c7282d9c0ffd2091611b5aa649356 100644 (file)
@@ -50,7 +50,7 @@ class StatusCommand : public ReplayerAdminSocketCommand {
 public:
   explicit StatusCommand(Replayer *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->print_status(f, ss);
     return true;
   }
@@ -63,7 +63,7 @@ class StartCommand : public ReplayerAdminSocketCommand {
 public:
   explicit StartCommand(Replayer *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->start();
     return true;
   }
@@ -76,7 +76,7 @@ class StopCommand : public ReplayerAdminSocketCommand {
 public:
   explicit StopCommand(Replayer *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->stop(true);
     return true;
   }
@@ -89,7 +89,7 @@ class RestartCommand : public ReplayerAdminSocketCommand {
 public:
   explicit RestartCommand(Replayer *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->restart();
     return true;
   }
@@ -102,7 +102,7 @@ class FlushCommand : public ReplayerAdminSocketCommand {
 public:
   explicit FlushCommand(Replayer *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->flush();
     return true;
   }
@@ -115,7 +115,7 @@ class LeaderReleaseCommand : public ReplayerAdminSocketCommand {
 public:
   explicit LeaderReleaseCommand(Replayer *replayer) : replayer(replayer) {}
 
-  bool call(Formatter *f, stringstream *ss) {
+  bool call(Formatter *f, stringstream *ss) override {
     replayer->release_leader();
     return true;
   }
@@ -177,7 +177,7 @@ public:
     }
   }
 
-  ~ReplayerAdminSocketHook() {
+  ~ReplayerAdminSocketHook() override {
     for (Commands::const_iterator i = commands.begin(); i != commands.end();
         ++i) {
       (void)admin_socket->unregister_command(i->first);
@@ -186,7 +186,7 @@ public:
   }
 
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
-           bufferlist& out) {
+           bufferlist& out) override {
     Commands::const_iterator i = commands.find(command);
     assert(i != commands.end());
     Formatter *f = Formatter::create(format);
index 7862b906a8e083ca08b79780b4aba2f58f1e150c..cf37048aa5db366b2360bcad9cff8950e4e7eaa5 100644 (file)
@@ -32,11 +32,11 @@ namespace {
 
 struct MirrorExclusiveLockPolicy : public librbd::exclusive_lock::Policy {
 
-  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 {
     // TODO: interlock is being requested (e.g. local promotion)
     // Wait for demote event from peer or abort replay on forced
     // promotion.
@@ -51,15 +51,15 @@ struct MirrorJournalPolicy : public librbd::journal::Policy {
   MirrorJournalPolicy(ContextWQ *work_queue) : work_queue(work_queue) {
   }
 
-  virtual bool append_disabled() const {
+  bool append_disabled() const override {
     // avoid recording any events to the local journal
     return true;
   }
-  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 {
     // rbd-mirror will manually create tags by copying them from the peer
     work_queue->queue(on_finish, 0);
   }
index 08384d42eba54563202545be729a7254a0e4fc5e..c3888c4e017dd02119afe4e592858ad15a5edac5 100644 (file)
@@ -337,7 +337,7 @@ private:
       ,func(_func)
     {}
   protected:
-    virtual void* entry()
+    void* entry() override
     {
       (server.*func)();
       server.shutdown();
@@ -428,9 +428,9 @@ public:
     , size(_size)
   { }
 
-  virtual ~NBDWatchCtx() {}
+  ~NBDWatchCtx() override {}
 
-  virtual void handle_notify()
+  void handle_notify() override
   {
     librbd::image_info_t info;
     if (image.stat(info, sizeof(info)) == 0) {