return 0;
}
+int rgw_rados_ref::watch(const DoutPrefixProvider* dpp, uint64_t* handle,
+ librados::WatchCtx2* ctx, optional_yield y)
+{
+ if (y) {
+ auto& yield = y.get_yield_context();
+ boost::system::error_code ec;
+ librados::async_watch(yield.get_executor(), ioctx, obj.oid,
+ handle, ctx, 0, yield[ec]);
+ return ceph::from_error_code(ec);
+ } else {
+ maybe_warn_about_blocking(dpp);
+ return ioctx.watch2(obj.oid, handle, ctx);
+ }
+}
+
+int rgw_rados_ref::unwatch(const DoutPrefixProvider* dpp, uint64_t handle,
+ optional_yield y)
+{
+ if (y) {
+ auto& yield = y.get_yield_context();
+ boost::system::error_code ec;
+ librados::async_unwatch(yield.get_executor(), ioctx, handle, yield[ec]);
+ return ceph::from_error_code(ec);
+ } else {
+ maybe_warn_about_blocking(dpp);
+ return ioctx.unwatch2(handle);
+ }
+}
map<string, bufferlist>* no_change_attrs() {
static map<string, bufferlist> no_change;
return ioctx.aio_operate(obj.oid, c, op, pbl);
}
- int watch(uint64_t* handle, librados::WatchCtx2* ctx) {
- return ioctx.watch2(obj.oid, handle, ctx);
- }
-
- int aio_watch(librados::AioCompletion* c, uint64_t* handle,
- librados::WatchCtx2 *ctx) {
- return ioctx.aio_watch(obj.oid, c, handle, ctx);
- }
+ int watch(const DoutPrefixProvider* dpp, uint64_t* handle,
+ librados::WatchCtx2* ctx, optional_yield y);
- int unwatch(uint64_t handle) {
- return ioctx.unwatch2(handle);
- }
+ int unwatch(const DoutPrefixProvider* dpp, uint64_t handle, optional_yield y);
int notify(const DoutPrefixProvider* dpp, bufferlist& bl, uint64_t timeout_ms,
bufferlist* pbl, optional_yield y) {