]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: add override for librados 13442/head
authorliuchang0812 <liuchang0812@gmail.com>
Wed, 15 Feb 2017 13:42:02 +0000 (21:42 +0800)
committerliuchang0812 <liuchang0812@gmail.com>
Wed, 15 Feb 2017 13:42:02 +0000 (21:42 +0800)
Fixes: http://tracker.ceph.com/issues/18922
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
src/librados/IoCtxImpl.cc
src/librados/RadosClient.cc
src/librados/librados.cc
src/test/librados/misc.cc
src/test/librados/tier.cc
src/test/librados/watch_notify.cc
src/test/librados_test_stub/TestRadosClient.cc

index 238e3c67069dbf680ebd841338ae6134e4bfe64f..504408b852fe65fcd4d8dcd94e7348890f0573a9 100644 (file)
@@ -51,7 +51,7 @@ struct C_notify_Finish : public Context {
     linger_op->notify_result_bl = &reply_bl;
   }
 
-  virtual void finish(int r)
+  void finish(int r) override
   {
     ldout(cct, 10) << __func__ << " completed notify (linger op "
                    << linger_op << "), r = " << r << dendl;
@@ -84,7 +84,7 @@ struct C_aio_linger_cancel : public Context {
   {
   }
 
-  virtual void finish(int r)
+  void finish(int r) override
   {
     objecter->linger_cancel(linger_op);
   }
@@ -101,7 +101,7 @@ struct C_aio_linger_Complete : public Context {
     c->get();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     if (cancel || r < 0)
       c->io->client->finisher.queue(new C_aio_linger_cancel(c->io->objecter,
                                                             linger_op));
@@ -137,7 +137,7 @@ struct C_aio_notify_Complete : public C_aio_linger_Complete {
     complete_unlock(r);
   }
 
-  virtual void complete(int r) override {
+  void complete(int r) override {
     // invoked by C_notify_Finish (or C_aio_notify_Ack on failure)
     lock.Lock();
     finished = true;
@@ -170,7 +170,7 @@ struct C_aio_notify_Ack : public Context {
   {
   }
 
-  virtual void finish(int r)
+  void finish(int r) override
   {
     ldout(cct, 10) << __func__ << " linger op " << oncomplete->linger_op << " "
                    << "acked (" << r << ")" << dendl;
@@ -192,7 +192,7 @@ struct C_aio_selfmanaged_snap_op_Complete : public Context {
     c->get();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     c->lock.Lock();
     c->rval = r;
     c->complete = true;
@@ -216,7 +216,7 @@ struct C_aio_selfmanaged_snap_create_Complete : public C_aio_selfmanaged_snap_op
       dest_snapid(dest_snapid) {
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     if (r >= 0) {
       *dest_snapid = snapid;
     }
@@ -888,7 +888,7 @@ class C_ObjectOperation : public Context {
 public:
   ::ObjectOperation m_ops;
   explicit C_ObjectOperation(Context *c) : m_ctx(c) {}
-  virtual void finish(int r) {
+  void finish(int r) override {
     m_ctx->complete(r);
   }
 private:
@@ -1566,7 +1566,7 @@ struct WatchInfo : public Objecter::WatchContext {
   void handle_notify(uint64_t notify_id,
                     uint64_t cookie,
                     uint64_t notifier_id,
-                    bufferlist& bl) {
+                    bufferlist& bl) override {
     ldout(ioctx->client->cct, 10) << __func__ << " " << notify_id
                                  << " cookie " << cookie
                                  << " notifier_id " << notifier_id
@@ -1583,7 +1583,7 @@ struct WatchInfo : public Objecter::WatchContext {
       ioctx->notify_ack(oid, notify_id, cookie, empty);
     }
   }
-  void handle_error(uint64_t cookie, int err) {
+  void handle_error(uint64_t cookie, int err) override {
     ldout(ioctx->client->cct, 10) << __func__ << " cookie " << cookie
                                  << " err " << err
                                  << dendl;
index 2045516eafe6dfbad16d49f94a4856860bba0920..f626ba87d2628041f6e4246d8eb054054c46b340 100644 (file)
@@ -396,7 +396,7 @@ struct C_aio_watch_flush_Complete : public Context {
     c->get();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     c->lock.Lock();
     c->rval = r;
     c->complete = true;
index 7b9816b4efa4917069df598b966c5f5fba1feabf..9b86f8f2b055b7f5d421190c6aa9ae2ce22e3952 100644 (file)
@@ -183,7 +183,7 @@ class ObjectOpCompletionCtx : public Context {
   bufferlist bl;
 public:
   explicit ObjectOpCompletionCtx(librados::ObjectOperationCompletion *c) : completion(c) {}
-  void finish(int r) {
+  void finish(int r) override {
     completion->handle_completion(r, bl);
     delete completion;
   }
@@ -1732,7 +1732,7 @@ struct AioUnlockCompletion : public librados::ObjectOperationCompletion {
   AioUnlockCompletion(librados::AioCompletion *c) : completion(c->pc) {
     completion->get();
   };
-  void handle_completion(int r, bufferlist& outbl) {
+  void handle_completion(int r, bufferlist& outbl) override {
     rados_callback_t cb = completion->callback_complete;
     void *cb_arg = completion->callback_complete_arg;
     cb(completion, cb_arg);
@@ -4852,7 +4852,7 @@ struct C_WatchCB : public librados::WatchCtx {
   rados_watchcb_t wcb;
   void *arg;
   C_WatchCB(rados_watchcb_t _wcb, void *_arg) : wcb(_wcb), arg(_arg) {}
-  void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) {
+  void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) override {
     wcb(opcode, ver, arg);
   }
 };
@@ -4881,10 +4881,10 @@ struct C_WatchCB2 : public librados::WatchCtx2 {
   void handle_notify(uint64_t notify_id,
                     uint64_t cookie,
                     uint64_t notifier_gid,
-                    bufferlist& bl) {
+                    bufferlist& bl) override {
     wcb(arg, notify_id, cookie, notifier_gid, bl.c_str(), bl.length());
   }
-  void handle_error(uint64_t cookie, int err) {
+  void handle_error(uint64_t cookie, int err) override {
     if (errcb)
       errcb(arg, cookie, err);
   }
@@ -5655,7 +5655,7 @@ public:
              size_t *bytes_read,
              int *prval) : out_buf(out_buf), out_len(out_len),
                            bytes_read(bytes_read), prval(prval) {}
-  void finish(int r) {
+  void finish(int r) override {
     if (out_bl.length() > out_len) {
       if (prval)
        *prval = -ERANGE;
@@ -5691,7 +5691,7 @@ public:
   bufferlist out_bl;
   C_out_buffer(char **out_buf, size_t *out_len) : out_buf(out_buf),
                                                  out_len(out_len) {}
-  void finish(int r) {
+  void finish(int r) override {
     // ignore r since we don't know the meaning of return values
     // from custom class methods
     do_out_buffer(out_bl, out_buf, out_len);
@@ -5744,7 +5744,7 @@ class C_OmapIter : public Context {
   RadosOmapIter *iter;
 public:
   explicit C_OmapIter(RadosOmapIter *iter) : iter(iter) {}
-  void finish(int r) {
+  void finish(int r) override {
     iter->i = iter->values.begin();
   }
 };
@@ -5753,7 +5753,7 @@ class C_XattrsIter : public Context {
   librados::RadosXattrsIter *iter;
 public:
   explicit C_XattrsIter(librados::RadosXattrsIter *iter) : iter(iter) {}
-  void finish(int r) {
+  void finish(int r) override {
     iter->i = iter->attrset.begin();
   }
 };
@@ -5821,7 +5821,7 @@ struct C_OmapKeysIter : public Context {
   RadosOmapIter *iter;
   std::set<std::string> keys;
   explicit C_OmapKeysIter(RadosOmapIter *iter) : iter(iter) {}
-  void finish(int r) {
+  void finish(int r) override {
     // map each key to an empty bl
     for (std::set<std::string>::const_iterator i = keys.begin();
         i != keys.end(); ++i) {
index 70a11ec766fe36d1a951e7271343224e022b3254..202c1c3af536516a196e260a68298699db0e5f86 100644 (file)
@@ -827,7 +827,7 @@ class LibRadosTwoPoolsECPP : public RadosTestECPP
 {
 public:
   LibRadosTwoPoolsECPP() {};
-  virtual ~LibRadosTwoPoolsECPP() {};
+  ~LibRadosTwoPoolsECPP() {};
 protected:
   static void SetUpTestCase() {
     pool_name = get_temp_pool_name();
@@ -841,12 +841,12 @@ protected:
   }
   static std::string src_pool_name;
 
-  virtual void SetUp() {
+  void SetUp() override {
     RadosTestECPP::SetUp();
     ASSERT_EQ(0, cluster.ioctx_create(src_pool_name.c_str(), src_ioctx));
     src_ioctx.set_namespace(nspace);
   }
-  virtual void TearDown() {
+  void TearDown() override {
     // wait for maps to settle before next test
     cluster.wait_for_latest_osdmap();
 
index 3b85de64fa137373bc8c5a6f00c2ff3425d3497a..0b0c78385c7c935e0c8412d89847c1f390d081b3 100755 (executable)
@@ -67,7 +67,7 @@ class LibRadosTwoPoolsPP : public RadosTestPP
 {
 public:
   LibRadosTwoPoolsPP() {};
-  virtual ~LibRadosTwoPoolsPP() {};
+  ~LibRadosTwoPoolsPP() {};
 protected:
   static void SetUpTestCase() {
     pool_name = get_temp_pool_name();
@@ -78,14 +78,14 @@ protected:
   }
   static std::string cache_pool_name;
 
-  virtual void SetUp() {
+  void SetUp() override {
     cache_pool_name = get_temp_pool_name();
     ASSERT_EQ(0, s_cluster.pool_create(cache_pool_name.c_str()));
     RadosTestPP::SetUp();
     ASSERT_EQ(0, cluster.ioctx_create(cache_pool_name.c_str(), cache_ioctx));
     cache_ioctx.set_namespace(nspace);
   }
-  virtual void TearDown() {
+  void TearDown() override {
     // flush + evict cache
     flush_evict_all(cluster, cache_ioctx);
 
@@ -2742,7 +2742,7 @@ class LibRadosTwoPoolsECPP : public RadosTestECPP
 {
 public:
   LibRadosTwoPoolsECPP() {};
-  virtual ~LibRadosTwoPoolsECPP() {};
+  ~LibRadosTwoPoolsECPP() {};
 protected:
   static void SetUpTestCase() {
     pool_name = get_temp_pool_name();
@@ -2753,14 +2753,14 @@ protected:
   }
   static std::string cache_pool_name;
 
-  virtual void SetUp() {
+  void SetUp() override {
     cache_pool_name = get_temp_pool_name();
     ASSERT_EQ(0, s_cluster.pool_create(cache_pool_name.c_str()));
     RadosTestECPP::SetUp();
     ASSERT_EQ(0, cluster.ioctx_create(cache_pool_name.c_str(), cache_ioctx));
     cache_ioctx.set_namespace(nspace);
   }
-  virtual void TearDown() {
+  void TearDown() override {
     // flush + evict cache
     flush_evict_all(cluster, cache_ioctx);
 
index 1458c304e37937bfcf25fb5594e6e026efcb140d..87bb579215656156d105a7b4edc9909f4be82734 100644 (file)
@@ -31,7 +31,7 @@ static void watch_notify_test_cb(uint8_t opcode, uint64_t ver, void *arg)
 class WatchNotifyTestCtx : public WatchCtx
 {
 public:
-    void notify(uint8_t opcode, uint64_t ver, bufferlist& bl)
+    void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) override
     {
       std::cout << __func__ << std::endl;
       sem_post(sem);
@@ -115,7 +115,7 @@ public:
   {}
 
   void handle_notify(uint64_t notify_id, uint64_t cookie, uint64_t notifier_gid,
-                    bufferlist& bl) {
+                    bufferlist& bl) override {
     std::cout << __func__ << " cookie " << cookie << " notify_id " << notify_id
              << " notifier_gid " << notifier_gid << std::endl;
     notify->notify_bl = bl;
@@ -127,7 +127,7 @@ public:
     notify_ioctx->notify_ack(notify->notify_oid, notify_id, cookie, reply);
   }
 
-  void handle_error(uint64_t cookie, int err) {
+  void handle_error(uint64_t cookie, int err) override {
     std::cout << __func__ << " cookie " << cookie
              << " err " << err << std::endl;
     assert(cookie > 1000);
index 3de726bd78b14f70d31d8cb8c889f42e665b1094..48a47f84dd29aedbfe4322b1934a7d8a1c782331 100644 (file)
@@ -64,7 +64,7 @@ public:
     }
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     int ret = m_callback();
     if (m_comp != NULL) {
       if (m_finisher != NULL) {