]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: no need for '2' suffix in c++
authorSage Weil <sage@redhat.com>
Thu, 13 Nov 2014 22:01:10 +0000 (14:01 -0800)
committerSage Weil <sage@redhat.com>
Thu, 4 Dec 2014 18:33:28 +0000 (10:33 -0800)
Compiler disambiguates based on the rest of the signature.

Signed-off-by: Sage Weil <sage@redhat.com>
src/include/rados/librados.hpp
src/librados/librados.cc
src/test/librados/watch_notify.cc
src/tools/rados/rados.cc

index c506b2e365ec5e590eb503c5943cd3d1be573a64..9c845221e0a02f35eb798f6ed4f8c81d94f1e8b0 100644 (file)
@@ -939,13 +939,13 @@ namespace librados
                    bufferlist *pbl);
 
     // watch/notify
-    int watch2(const std::string& o, uint64_t *handle,
-              librados::WatchCtx2 *ctx);
+    int watch(const std::string& o, uint64_t *handle,
+             librados::WatchCtx2 *ctx);
     int unwatch(const std::string& o, uint64_t handle);
-    int notify2(const std::string& o,   ///< object
-               bufferlist& bl,         ///< optional broadcast payload
-               uint64_t timeout_ms,    ///< timeout (in ms)
-               bufferlist *pbl);       ///< reply buffer
+    int notify(const std::string& o,   ///< object
+              bufferlist& bl,         ///< optional broadcast payload
+              uint64_t timeout_ms,    ///< timeout (in ms)
+              bufferlist *pbl);       ///< reply buffer
     int list_watchers(const std::string& o, std::list<obj_watch_t> *out_watchers);
     int list_snaps(const std::string& o, snap_set_t *out_snaps);
     void set_notify_timeout(uint32_t timeout);
index 3da21be13fe1ce7b52ce6a1d639a125f125c67a3..0663f20817b17a4271d9a80565b4131b441f9995 100644 (file)
@@ -1666,8 +1666,8 @@ int librados::IoCtx::watch(const string& oid, uint64_t ver, uint64_t *cookie,
   return io_ctx_impl->watch(obj, cookie, ctx, NULL);
 }
 
-int librados::IoCtx::watch2(const string& oid, uint64_t *cookie,
-                           librados::WatchCtx2 *ctx2)
+int librados::IoCtx::watch(const string& oid, uint64_t *cookie,
+                          librados::WatchCtx2 *ctx2)
 {
   object_t obj(oid);
   return io_ctx_impl->watch(obj, cookie, NULL, ctx2);
@@ -1686,8 +1686,8 @@ int librados::IoCtx::notify(const string& oid, uint64_t ver, bufferlist& bl)
   return io_ctx_impl->notify(obj, bl, 0, NULL, NULL, NULL);
 }
 
-int librados::IoCtx::notify2(const string& oid, bufferlist& bl,
-                            uint64_t timeout_ms, bufferlist *preplybl)
+int librados::IoCtx::notify(const string& oid, bufferlist& bl,
+                           uint64_t timeout_ms, bufferlist *preplybl)
 {
   object_t obj(oid);
   return io_ctx_impl->notify(obj, bl, timeout_ms, preplybl, NULL, NULL);
index deaaf9a4711088e6200b7f54d5eb84c67e80e727..774de0938a1fb472db6dfd77557fb8535e06a9d2 100644 (file)
@@ -337,12 +337,12 @@ TEST_P(LibRadosWatchNotifyPP, WatchNotify2) {
   ASSERT_EQ(0, ioctx.write(notify_oid, bl1, sizeof(buf), 0));
   uint64_t handle;
   WatchNotifyTestCtx2 ctx;
-  ASSERT_EQ(0, ioctx.watch2(notify_oid, &handle, &ctx));
+  ASSERT_EQ(0, ioctx.watch(notify_oid, &handle, &ctx));
   std::list<obj_watch_t> watches;
   ASSERT_EQ(0, ioctx.list_watchers(notify_oid, &watches));
   ASSERT_EQ(watches.size(), 1u);
   bufferlist bl2, bl_reply;
-  ASSERT_EQ(0, ioctx.notify2(notify_oid, bl2, 0, &bl_reply));
+  ASSERT_EQ(0, ioctx.notify(notify_oid, bl2, 0, &bl_reply));
   bufferlist::iterator p = bl_reply.begin();
   std::multimap<uint64_t,bufferlist> reply_map;
   ::decode(reply_map, p);
@@ -448,14 +448,14 @@ TEST_P(LibRadosWatchNotifyPP, WatchNotify2Timeout) {
   ASSERT_EQ(0, ioctx.write(notify_oid, bl1, sizeof(buf), 0));
   uint64_t handle;
   WatchNotifyTestCtx2 ctx;
-  ASSERT_EQ(0, ioctx.watch2(notify_oid, &handle, &ctx));
+  ASSERT_EQ(0, ioctx.watch(notify_oid, &handle, &ctx));
   std::list<obj_watch_t> watches;
   ASSERT_EQ(0, ioctx.list_watchers(notify_oid, &watches));
   ASSERT_EQ(watches.size(), 1u);
   ASSERT_EQ(0u, notify_cookies.size());
   bufferlist bl2, bl_reply;
-  ASSERT_EQ(-ETIMEDOUT, ioctx.notify2(notify_oid, bl2, 1000 /* 1s */,
-                                     &bl_reply));
+  ASSERT_EQ(-ETIMEDOUT, ioctx.notify(notify_oid, bl2, 1000 /* 1s */,
+                                    &bl_reply));
   int wait = 10;
   while (!notify_failed && --wait)
     sleep(1);
index 214af596b07df712b34274e52beed75df98066b2..374e12949754add0868954597c4ce1629c75eee2 100644 (file)
@@ -2366,7 +2366,7 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
     string oid(nargs[1]);
     RadosWatchCtx ctx(io_ctx, oid.c_str());
     uint64_t cookie;
-    ret = io_ctx.watch2(oid, &cookie, &ctx);
+    ret = io_ctx.watch(oid, &cookie, &ctx);
     if (ret != 0)
       cerr << "error calling watch: " << ret << std::endl;
     else {