/* watch/notify */
typedef void (*rados_watchcb_t)(uint8_t opcode, uint64_t ver, void *arg);
-int rados_watch(rados_pool_t pool, const char *o, uint64_t ver, uint64_t *cookie,
+int rados_watch(rados_pool_t pool, const char *o, uint64_t ver, uint64_t *handle,
rados_watchcb_t watchcb, void *arg);
-int rados_unwatch(rados_pool_t pool, const char *o, uint64_t cookie);
+int rados_unwatch(rados_pool_t pool, const char *o, uint64_t handle);
int rados_notify(rados_pool_t pool, const char *o, uint64_t ver);
#ifdef __cplusplus
};
// watch/notify
- int watch(pool_t pool, const string& o, uint64_t ver, uint64_t *cookie, librados::Rados::WatchCtx *ctx);
- int unwatch(pool_t pool, const string& o, uint64_t cookie);
+ int watch(pool_t pool, const string& o, uint64_t ver, uint64_t *handle, librados::Rados::WatchCtx *ctx);
+ int unwatch(pool_t pool, const string& o, uint64_t handle);
int notify(pool_t pool, const string& o, uint64_t ver);
};
return client->watch(*(RadosClient::PoolCtx *)pool, oid, ver, cookie, ctx);
}
-int Rados::unwatch(pool_t pool, const string& o, uint64_t cookie)
+int Rados::unwatch(pool_t pool, const string& o, uint64_t handle)
{
+ uint64_t cookie = handle;
if (!client)
return -EINVAL;
object_t oid(o);
}
};
-int rados_watch(rados_pool_t pool, const char *o, uint64_t ver, uint64_t *cookie,
+int rados_watch(rados_pool_t pool, const char *o, uint64_t ver, uint64_t *handle,
rados_watchcb_t watchcb, void *arg)
{
+ uint64_t *cookie = handle;
RadosClient::PoolCtx *ctx = (RadosClient::PoolCtx *)pool;
object_t oid(o);
C_WatchCB *wc = new C_WatchCB(watchcb, arg);
return radosp->watch(*ctx, oid, ver, cookie, wc);
}
-int rados_unwatch(rados_pool_t pool, const char *o, uint64_t cookie)
+int rados_unwatch(rados_pool_t pool, const char *o, uint64_t handle)
{
+ uint64_t cookie = handle;
RadosClient::PoolCtx *ctx = (RadosClient::PoolCtx *)pool;
object_t oid(o);
return radosp->unwatch(*ctx, oid, cookie);