From: Sage Weil Date: Wed, 28 Aug 2013 22:41:31 +0000 (-0700) Subject: librados: add get_version64() X-Git-Tag: v0.69~34^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=985a1405db6364d4283b68c681d6a4e816decf7e;p=ceph.git 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 --- diff --git a/PendingReleaseNotes b/PendingReleaseNotes index ccbe0596b70b..6609acbd5a82 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 cf193b36d727..bc0bcc95ceb5 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 f704412559fb..12372d960b1b 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;