From 985a1405db6364d4283b68c681d6a4e816decf7e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 28 Aug 2013 15:41:31 -0700 Subject: [PATCH] librados: add get_version64() The C++ AioCompletion::get_version() method only returns 32-bits. Sigh. Add a get_version64() method that returns all 64-bits. Do not touch the 32-bit version to avoid breaking the ABI. Backport: dumpling, cuttlefish Signed-off-by: Sage Weil --- PendingReleaseNotes | 10 +++++++++- src/include/rados/librados.hpp | 3 ++- src/librados/librados.cc | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index ccbe0596b70bc..6609acbd5a825 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -17,4 +17,12 @@ v0.68 is probably how it should have been acting from the beginning. Users are unlikely to notice but it could result in lower performance in some circumstances. Those who care should switch to using the async interfaces, - which let you specify safety semantics precisely. \ No newline at end of file + which let you specify safety semantics precisely. + +* The C++ librados AioComplete::get_version() method was incorrectly + returning an int (usually 32-bits). To avoid breaking library + compatibility, a get_version64() method is added that returns the + full-width value. The old method is deprecated and will be removed + in a future release. Users of the C++ librados API that make use of + the get_version() method should modify their code to avoid getting a + value that is truncated from 64 to to 32 bits. \ No newline at end of file diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp index cf193b36d7271..bc0bcc95ceb54 100644 --- a/src/include/rados/librados.hpp +++ b/src/include/rados/librados.hpp @@ -96,7 +96,8 @@ namespace librados bool is_complete_and_cb(); bool is_safe_and_cb(); int get_return_value(); - int get_version(); + int get_version(); ///< DEPRECATED get_version() only returns 32-bits + uint64_t get_version64(); void release(); AioCompletionImpl *pc; }; diff --git a/src/librados/librados.cc b/src/librados/librados.cc index f704412559fb7..12372d960b1b0 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -592,6 +592,12 @@ int librados::AioCompletion::AioCompletion::get_version() return c->get_version(); } +uint64_t librados::AioCompletion::AioCompletion::get_version64() +{ + AioCompletionImpl *c = (AioCompletionImpl *)pc; + return c->get_version(); +} + void librados::AioCompletion::AioCompletion::release() { AioCompletionImpl *c = (AioCompletionImpl *)pc;