lock->Lock();
WatchContext *wc = new WatchContext(this, oid, ctx);
- client->register_watcher(wc, cookie);
+ client->register_watch_notify_callback(wc, cookie);
prepare_assert_ops(&wr);
wr.watch(*cookie, ver, 1);
bufferlist bl;
if (r < 0) {
lock->Lock();
- client->unregister_watcher(*cookie);
+ client->unregister_watch_notify_callback(*cookie);
lock->Unlock();
}
version_t ver;
lock->Lock();
- client->unregister_watcher(cookie);
+ client->unregister_watch_notify_callback(cookie);
::ObjectOperation wr;
prepare_assert_ops(&wr);
lock->Lock();
WatchContext *wc = new WatchContext(this, oid, ctx);
- client->register_watcher(wc, &cookie);
+ client->register_watch_notify_callback(wc, &cookie);
uint32_t prot_ver = 1;
uint32_t timeout = notify_timeout;
::encode(prot_ver, inbl);
mylock_all.Unlock();
lock->Lock();
- client->unregister_watcher(cookie);
+ client->unregister_watch_notify_callback(cookie);
lock->Unlock();
set_sync_op_version(objver);
return r;
}
-void librados::RadosClient::register_watcher(WatchContext *wc, uint64_t *cookie)
+void librados::RadosClient::register_watch_notify_callback(
+ WatchContext *wc,
+ uint64_t *cookie)
{
assert(lock.is_locked_by_me());
wc->cookie = *cookie = ++max_watch_cookie;
watchers[wc->cookie] = wc;
}
-void librados::RadosClient::unregister_watcher(uint64_t cookie)
+void librados::RadosClient::unregister_watch_notify_callback(uint64_t cookie)
{
assert(lock.is_locked_by_me());
map<uint64_t, WatchContext *>::iterator iter = watchers.find(cookie);
watchers.erase(iter);
lock.Unlock();
- ldout(cct, 10) << "unregister_watcher, dropping reference, waiting ctx=" << (void *)ctx << dendl;
+ ldout(cct, 10) << __func__ << " dropping reference, waiting ctx=" << (void *)ctx << dendl;
ctx->put_wait();
- ldout(cct, 10) << "unregister_watcher, done ctx=" << (void *)ctx << dendl;
+ ldout(cct, 10) << __func__ << " done ctx=" << (void *)ctx << dendl;
lock.Lock();
}
}
uint64_t max_watch_cookie;
map<uint64_t, librados::WatchContext *> watchers;
- void register_watcher(librados::WatchContext *wc, uint64_t *cookie);
- void unregister_watcher(uint64_t cookie);
+ void register_watch_notify_callback(librados::WatchContext *wc,
+ uint64_t *cookie);
+ void unregister_watch_notify_callback(uint64_t cookie);
void watch_notify(MWatchNotify *m);
int mon_command(const vector<string>& cmd, const bufferlist &inbl,
bufferlist *outbl, string *outs);