* @param cluster the cluster handle
*/
CEPH_RADOS_API int rados_watch_flush(rados_t cluster);
+/**
+ * Flush watch/notify callbacks
+ *
+ * This call will be nonblock, and the completion will be called
+ * until all pending watch/notify callbacks have been executed and
+ * the queue is empty. It should usually be called after shutting
+ * down any watches before shutting down the ioctx or
+ * librados to ensure that any callbacks do not misuse the ioctx (for
+ * example by calling rados_notify_ack after the ioctx has been
+ * destroyed).
+ *
+ * @param cluster the cluster handle
+ * @param completion what to do when operation has been attempted
+ */
+CEPH_RADOS_API int rados_aio_watch_flush(rados_t cluster, rados_completion_t completion);
/** @} Watch/Notify */
int connect();
void shutdown();
int watch_flush();
+ int aio_watch_flush(AioCompletion*);
int conf_read_file(const char * const path) const;
int conf_parse_argv(int argc, const char ** argv) const;
int conf_parse_argv_remainder(int argc, const char ** argv,
return client->watch_flush();
}
+int librados::Rados::aio_watch_flush(AioCompletion *c)
+{
+ if (!client)
+ return -EINVAL;
+ return client->async_watch_flush(c->pc);
+}
+
void librados::Rados::shutdown()
{
if (!client)
return retval;
}
+extern "C" int rados_aio_watch_flush(rados_t cluster, rados_completion_t completion)
+{
+ tracepoint(librados, rados_aio_watch_flush_enter, cluster, completion);
+ librados::RadosClient *client = (librados::RadosClient *)cluster;
+ librados::AioCompletionImpl *c = (librados::AioCompletionImpl*)completion;
+ int retval = client->async_watch_flush(c);
+ tracepoint(librados, rados_aio_watch_flush_exit, retval);
+ return retval;
+}
+
extern "C" int rados_set_alloc_hint(rados_ioctx_t io, const char *o,
uint64_t expected_object_size,
uint64_t expected_write_size)
)
)
+TRACEPOINT_EVENT(librados, rados_aio_watch_flush_enter,
+ TP_ARGS(
+ rados_t, cluster,
+ rados_completion_t, completion),
+ TP_FIELDS(
+ ctf_integer_hex(rados_t, cluster, cluster)
+ ctf_integer_hex(rados_completion_t, completion, completion)
+ )
+)
+
+TRACEPOINT_EVENT(librados, rados_aio_watch_flush_exit,
+ TP_ARGS(
+ int, retval),
+ TP_FIELDS(
+ ctf_integer(int, retval, retval)
+ )
+)
+
TRACEPOINT_EVENT(librados, rados_set_alloc_hint_enter,
TP_ARGS(
rados_ioctx_t, ioctx,