*/
CEPH_RADOS_API int rados_unwatch2(rados_ioctx_t io, uint64_t cookie);
+/**
+ * Asynchronous unregister an interest in an object
+ *
+ * Once this completes, no more notifies will be sent to us for this
+ * watch. This should be called to clean up unneeded watchers.
+ *
+ * @param io the pool the object is in
+ * @param completion what to do when operation has been attempted
+ * @param cookie which watch to unregister
+ * @returns 0 on success, negative error code on failure
+ */
+CEPH_RADOS_API int rados_aio_unwatch(rados_ioctx_t io, uint64_t cookie,
+ rados_completion_t completion);
+
/**
* Sychronously notify watchers of an object
*
int aio_watch(const std::string& o, AioCompletion *c, uint64_t *handle,
librados::WatchCtx2 *ctx);
int unwatch2(uint64_t handle);
+ int aio_unwatch(uint64_t handle, AioCompletion *c);
/**
* Send a notify event ot watchers
*
return r;
}
+int librados::IoCtxImpl::aio_unwatch(uint64_t cookie, AioCompletionImpl *c)
+{
+ c->io = this;
+ Objecter::LingerOp *linger_op = reinterpret_cast<Objecter::LingerOp*>(cookie);
+ Context *oncomplete = new C_aio_linger_Complete(c, linger_op, true);
+ version_t ver = 0;
+
+ ::ObjectOperation wr;
+ prepare_assert_ops(&wr);
+ wr.watch(cookie, CEPH_OSD_WATCH_OP_UNWATCH);
+ objecter->mutate(linger_op->target.base_oid, oloc, wr,
+ snapc, ceph::real_clock::now(client->cct), 0, NULL,
+ oncomplete, &ver);
+ return 0;
+}
+
int librados::IoCtxImpl::notify(const object_t& oid, bufferlist& bl,
uint64_t timeout_ms,
bufferlist *preply_bl,
librados::WatchCtx *ctx, librados::WatchCtx2 *ctx2);
int watch_check(uint64_t cookie);
int unwatch(uint64_t cookie);
+ int aio_unwatch(uint64_t cookie, AioCompletionImpl *c);
int notify(const object_t& oid, bufferlist& bl, uint64_t timeout_ms,
bufferlist *preplybl, char **preply_buf, size_t *preply_buf_len);
int notify_ack(const object_t& oid, uint64_t notify_id, uint64_t cookie,
return io_ctx_impl->unwatch(handle);
}
+int librados::IoCtx::aio_unwatch(uint64_t handle, AioCompletion *c)
+{
+ return io_ctx_impl->aio_unwatch(handle, c->pc);
+}
+
int librados::IoCtx::watch_check(uint64_t handle)
{
return io_ctx_impl->watch_check(handle);