From d3ec70ee13245f3aa30939c61bd1d260883ced61 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 13 Nov 2014 13:53:23 -0800 Subject: [PATCH] librados: mark old watch calls deprecated Signed-off-by: Sage Weil --- src/include/rados/librados.h | 8 +++++--- src/include/rados/librados.hpp | 9 ++++++--- src/test/librados/watch_notify.cc | 5 +++++ src/test/multi_stress_watch.cc | 5 +++++ src/test/system/st_rados_notify.cc | 5 +++++ src/test/system/st_rados_watch.cc | 5 +++++ src/test/test_stress_watch.cc | 5 +++++ 7 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/include/rados/librados.h b/src/include/rados/librados.h index f2b5771599f5e..fbb02c8129ee8 100644 --- a/src/include/rados/librados.h +++ b/src/include/rados/librados.h @@ -1949,8 +1949,9 @@ typedef void (*rados_watchfailcb_t)(void *arg, * @returns -ERANGE if the version of the object is greater than ver */ CEPH_RADOS_API int rados_watch(rados_ioctx_t io, const char *o, uint64_t ver, - uint64_t *handle, rados_watchcb_t watchcb, - void *arg); + uint64_t *handle, + rados_watchcb_t watchcb, void *arg) + __attribute__((deprecated)); /** @@ -2012,7 +2013,8 @@ CEPH_RADOS_API int rados_unwatch(rados_ioctx_t io, const char *o, * @returns 0 on success, negative error code on failure */ CEPH_RADOS_API int rados_notify(rados_ioctx_t io, const char *o, uint64_t ver, - const char *buf, int buf_len); + const char *buf, int buf_len) + __attribute__((deprecated)); /** * Sychronously notify watchers of an object diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp index 74883cec4ba09..99b9a95568f9b 100644 --- a/src/include/rados/librados.hpp +++ b/src/include/rados/librados.hpp @@ -937,12 +937,9 @@ namespace librados bufferlist *pbl); // watch/notify - int watch(const std::string& o, uint64_t ver, uint64_t *handle, - librados::WatchCtx *ctx) __attribute__ ((deprecated)); int watch2(const std::string& o, uint64_t *handle, librados::WatchCtx2 *ctx); int unwatch(const std::string& o, uint64_t handle); - int notify(const std::string& o, uint64_t ver, bufferlist& bl) __attribute__ ((deprecated)); int notify2(const std::string& o, ///< object bufferlist& bl, ///< optional broadcast payload uint64_t timeout_ms, ///< timeout (in ms) @@ -957,6 +954,12 @@ namespace librados uint64_t handle, ///< our watch handle bufferlist& bl); ///< optional reply payload + // old, deprecated versions + int watch(const std::string& o, uint64_t ver, uint64_t *handle, + librados::WatchCtx *ctx) __attribute__ ((deprecated)); + int notify(const std::string& o, uint64_t ver, bufferlist& bl) + __attribute__ ((deprecated)); + /** * Set allocation hint for an object * diff --git a/src/test/librados/watch_notify.cc b/src/test/librados/watch_notify.cc index 8c436d050e15e..deaaf9a471108 100644 --- a/src/test/librados/watch_notify.cc +++ b/src/test/librados/watch_notify.cc @@ -111,6 +111,9 @@ public: // -- +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + TEST_F(LibRadosWatchNotify, WatchNotify) { ASSERT_EQ(0, sem_init(&sem, 0, 0)); char buf[128]; @@ -219,6 +222,8 @@ TEST_F(LibRadosWatchNotifyECPP, WatchNotifyTimeout) { ASSERT_EQ(0, ioctx.unwatch("foo", handle)); } +#pragma GCC diagnostic pop + // -- diff --git a/src/test/multi_stress_watch.cc b/src/test/multi_stress_watch.cc index 6203d7b129812..aa02d6941dbb2 100644 --- a/src/test/multi_stress_watch.cc +++ b/src/test/multi_stress_watch.cc @@ -29,6 +29,9 @@ public: } }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + void test_loop(Rados &cluster, std::string pool_name, std::string obj_name) { @@ -63,6 +66,8 @@ test_loop(Rados &cluster, std::string pool_name, std::string obj_name) ioctx.close(); } +#pragma GCC diagnostic pop + void test_replicated(Rados &cluster, std::string pool_name, std::string obj_name) { diff --git a/src/test/system/st_rados_notify.cc b/src/test/system/st_rados_notify.cc index e74711cb6410c..b5fea3ecab27a 100644 --- a/src/test/system/st_rados_notify.cc +++ b/src/test/system/st_rados_notify.cc @@ -38,6 +38,9 @@ StRadosNotify::~StRadosNotify() { } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + int StRadosNotify::run() { rados_t cl; @@ -72,3 +75,5 @@ int StRadosNotify::run() return 0; } + +#pragma GCC diagnostic pop diff --git a/src/test/system/st_rados_watch.cc b/src/test/system/st_rados_watch.cc index 38b7b5eee85a6..ba58e474ade14 100644 --- a/src/test/system/st_rados_watch.cc +++ b/src/test/system/st_rados_watch.cc @@ -47,6 +47,9 @@ StRadosWatch:: { } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + int StRadosWatch:: run() { @@ -94,3 +97,5 @@ run() return r; } + +#pragma GCC diagnostic pop diff --git a/src/test/test_stress_watch.cc b/src/test/test_stress_watch.cc index 52b480b4576c2..c9813e698f54a 100644 --- a/src/test/test_stress_watch.cc +++ b/src/test/test_stress_watch.cc @@ -35,6 +35,9 @@ public: } }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + struct WatcherUnwatcher : public Thread { string pool; WatcherUnwatcher(string& _pool) : pool(_pool) {} @@ -116,3 +119,5 @@ TEST_P(WatchStress, Stress1) { ASSERT_EQ(0, destroy_one_pool_pp(pool_name, ncluster)); sem_destroy(&sem); } + +#pragma GCC diagnostic pop -- 2.39.5