*
* @param cb_arg application-defined data passed to the callback functions
* @param cb_complete the function to be called when the operation is
- * in memory on all relpicas
+ * in memory on all replicas
* @param cb_safe the function to be called when the operation is on
* stable storage on all replicas
* @param pc where to store the completion
rados_callback_t cb_safe,
rados_completion_t *pc);
+/**
+ * Constructs a completion to use with asynchronous operations
+ *
+ * The complete callback corresponds to operation being acked.
+ *
+ * @note BUG: this should check for ENOMEM instead of throwing an exception
+ *
+ * @param cb_arg application-defined data passed to the callback functions
+ * @param cb_complete the function to be called when the operation is committed
+ * on all replicas
+ * @param pc where to store the completion
+ * @returns 0
+ */
+CEPH_RADOS_API int rados_aio_create_completion2(void *cb_arg,
+ rados_callback_t cb_complete,
+ rados_completion_t *pc);
+
/**
* Block until an operation completes
*
}
LIBRADOS_C_API_BASE_DEFAULT(rados_aio_create_completion);
+extern "C" int _rados_aio_create_completion2(void *cb_arg,
+ rados_callback_t cb_complete,
+ rados_completion_t *pc)
+{
+ tracepoint(librados, rados_aio_create_completion2_enter, cb_arg, cb_complete);
+ librados::AioCompletionImpl *c = new librados::AioCompletionImpl;
+ if (cb_complete)
+ c->set_complete_callback(cb_arg, cb_complete);
+ *pc = c;
+ tracepoint(librados, rados_aio_create_completion2_exit, 0, *pc);
+ return 0;
+}
+LIBRADOS_C_API_BASE_DEFAULT(rados_aio_create_completion2);
+
extern "C" int _rados_aio_wait_for_complete(rados_completion_t c)
{
tracepoint(librados, rados_aio_wait_for_complete_enter, c);
)
)
+TRACEPOINT_EVENT(librados, rados_aio_create_completion2_enter,
+ TP_ARGS(
+ void*, cb_arg,
+ rados_callback_t, cb_complete),
+ TP_FIELDS(
+ ctf_integer_hex(void*, cb_arg, cb_arg)
+ ctf_integer_hex(rados_callback_t, cb_complete, cb_complete)
+ )
+)
+
+TRACEPOINT_EVENT(librados, rados_aio_create_completion2_exit,
+ TP_ARGS(
+ int, retval,
+ rados_completion_t, completion),
+ TP_FIELDS(
+ ctf_integer(int, retval, retval)
+ ctf_integer_hex(rados_completion_t, completion, completion)
+ )
+)
+
TRACEPOINT_EVENT(librados, rados_aio_wait_for_complete_enter,
TP_ARGS(
rados_completion_t, completion),