Skip to content

Commit

Permalink
librados: add get_version64()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Sage Weil committed Aug 29, 2013
1 parent 3e63c1a commit 985a140
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 9 additions & 1 deletion PendingReleaseNotes
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.
3 changes: 2 additions & 1 deletion src/include/rados/librados.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
6 changes: 6 additions & 0 deletions src/librados/librados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 985a140

Please sign in to comment.