return "???";
}
+const char *ceph_watch_event_name(int e)
+{
+ switch (e) {
+ case CEPH_WATCH_EVENT_NOTIFY: return "notify";
+ case CEPH_WATCH_EVENT_NOTIFY_COMPLETE: return "notify_complete";
+ }
+ return "???";
+}
+
const char *ceph_pool_op_name(int op)
{
switch (op) {
/* watch-notify operations */
enum {
- WATCH_NOTIFY = 1, /* notifying watcher */
- WATCH_NOTIFY_COMPLETE = 2, /* notifier notified when done */
+ CEPH_WATCH_EVENT_NOTIFY = 1, /* notifying watcher */
+ CEPH_WATCH_EVENT_NOTIFY_COMPLETE = 2, /* notifier notified when done */
};
+const char *ceph_watch_event_name(int o);
/* pool operations */
enum {
assert(!!wc->watch_ctx ^ !!wc->watch_ctx2); // only one is defined
lock.Unlock();
if (wc->watch_ctx) {
- wc->watch_ctx->notify(WATCH_NOTIFY, m->ver, m->bl);
+ wc->watch_ctx->notify(CEPH_WATCH_EVENT_NOTIFY, m->ver, m->bl);
// send ACK back to the OSD
bufferlist empty;
wc->io_ctx_impl->notify_ack(wc->oid, m->notify_id, m->cookie, empty);
uint64_t cookie; ///< client unique id for this watch or notify
uint64_t ver; ///< unused
uint64_t notify_id; ///< osd unique id for a notify notification
- uint8_t opcode; ///< always WATCH_NOTIFY
+ uint8_t opcode; ///< CEPH_WATCH_EVENT_*
bufferlist bl; ///< notify payload (osd->client)
int32_t return_code; ///< notify result (osd->client)
uint64_t notifier_gid; ///< who sent the notify
::encode(notify_replies, bl);
bufferlist empty;
MWatchNotify *reply(new MWatchNotify(cookie, version, notify_id,
- WATCH_NOTIFY, empty));
+ CEPH_WATCH_EVENT_NOTIFY_COMPLETE, empty));
reply->notifier_gid = client_gid;
reply->set_data(bl);
if (timed_out)
dout(10) << "send_notify" << dendl;
MWatchNotify *notify_msg = new MWatchNotify(
cookie, notif->version, notif->notify_id,
- WATCH_NOTIFY, notif->payload);
+ CEPH_WATCH_EVENT_NOTIFY, notif->payload);
notify_msg->notifier_gid = notif->client_gid;
osd->send_message_osd_client(notify_msg, conn.get());
}