diff options
author | Sage Weil <sage@newdream.net> | 2012-04-17 11:21:22 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2012-04-17 11:39:19 -0700 |
commit | 98e2369efd1d754fcd825dd2abc0deba5f5f5f69 (patch) | |
tree | 8d2959475183714ca20ddcfe6af313eca5863193 /src/include | |
parent | 0be9718afc6613b0d3fb003b66d942e70c3cfeeb (diff) | |
download | ceph-98e2369efd1d754fcd825dd2abc0deba5f5f5f69.tar.gz |
librados: add methods to check and wait for safe/complete -and- callback
Allow user to check for (safe|complete) -and- callback return, and wait
for that condition.
Fixes: #2301
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/rados/librados.h | 40 | ||||
-rw-r--r-- | src/include/rados/librados.hpp | 4 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/include/rados/librados.h b/src/include/rados/librados.h index fe6e1710951..61bdf6d157e 100644 --- a/src/include/rados/librados.h +++ b/src/include/rados/librados.h @@ -1227,6 +1227,46 @@ int rados_aio_is_complete(rados_completion_t c); int rados_aio_is_safe(rados_completion_t c); /** + * Block until an operation completes and callback completes + * + * This means it is in memory on all replicas and can be read. + * + * @note BUG: this should be void + * + * @param c operation to wait for + * @returns 0 + */ +int rados_aio_wait_for_complete_and_cb(rados_completion_t c); + +/** + * Block until an operation is safe and callback has completed + * + * This means it is on stable storage on all replicas. + * + * @note BUG: this should be void + * + * @param c operation to wait for + * @returns 0 + */ +int rados_aio_wait_for_safe_and_cb(rados_completion_t c); + +/** + * Has an asynchronous operation and callback completed + * + * @param c async operation to inspect + * @returns whether c is complete + */ +int rados_aio_is_complete_and_cb(rados_completion_t c); + +/** + * Is an asynchronous operation safe and has the callback completed + * + * @param c async operation to inspect + * @returns whether c is safe + */ +int rados_aio_is_safe_and_cb(rados_completion_t c); + +/** * Get the return value of an asychronous operation * * The return value is set when the operation is complete or safe, diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp index 89d3ea1404b..64101481b63 100644 --- a/src/include/rados/librados.hpp +++ b/src/include/rados/librados.hpp @@ -88,8 +88,12 @@ namespace librados int set_safe_callback(void *cb_arg, callback_t cb); int wait_for_complete(); int wait_for_safe(); + int wait_for_complete_and_cb(); + int wait_for_safe_and_cb(); bool is_complete(); bool is_safe(); + bool is_complete_and_cb(); + bool is_safe_and_cb(); int get_return_value(); int get_version(); void release(); |