From: Radoslaw Zarzynski Date: Tue, 24 Dec 2019 12:57:23 +0000 (+0100) Subject: messages: MWatchNotify takes notifier_gid during construction. X-Git-Tag: v15.1.1~415^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=241838cf581532ee7fe71df225601db77af34d89;p=ceph.git messages: MWatchNotify takes notifier_gid during construction. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/messages/MWatchNotify.h b/src/messages/MWatchNotify.h index 7a31ec8c56b..a37dc8c85a5 100644 --- a/src/messages/MWatchNotify.h +++ b/src/messages/MWatchNotify.h @@ -35,7 +35,7 @@ private: MWatchNotify() : Message{CEPH_MSG_WATCH_NOTIFY, HEAD_VERSION, COMPAT_VERSION} { } - MWatchNotify(uint64_t c, uint64_t v, uint64_t i, uint8_t o, ceph::buffer::list b) + MWatchNotify(uint64_t c, uint64_t v, uint64_t i, uint8_t o, ceph::buffer::list b, uint64_t n=0) : Message{CEPH_MSG_WATCH_NOTIFY, HEAD_VERSION, COMPAT_VERSION}, cookie(c), ver(v), @@ -43,7 +43,7 @@ private: opcode(o), bl(b), return_code(0), - notifier_gid(0) { } + notifier_gid(n) { } private: ~MWatchNotify() override {} diff --git a/src/osd/Watch.cc b/src/osd/Watch.cc index 48fe50c07c1..c1e26f230c7 100644 --- a/src/osd/Watch.cc +++ b/src/osd/Watch.cc @@ -192,9 +192,13 @@ void Notify::maybe_complete_notify() encode(missed, bl); bufferlist empty; - MWatchNotify *reply(new MWatchNotify(cookie, version, notify_id, - CEPH_WATCH_EVENT_NOTIFY_COMPLETE, empty)); - reply->notifier_gid = client_gid; + auto* const reply = new MWatchNotify( + cookie, + version, + notify_id, + CEPH_WATCH_EVENT_NOTIFY_COMPLETE, + empty, + client_gid); reply->set_data(bl); if (timed_out) reply->return_code = -ETIMEDOUT; @@ -473,9 +477,12 @@ void Watch::send_notify(NotifyRef notif) { dout(10) << "send_notify" << dendl; MWatchNotify *notify_msg = new MWatchNotify( - cookie, notif->version, notif->notify_id, - CEPH_WATCH_EVENT_NOTIFY, notif->payload); - notify_msg->notifier_gid = notif->client_gid; + cookie, + notif->version, + notif->notify_id, + CEPH_WATCH_EVENT_NOTIFY, + notif->payload, + notif->client_gid); conn->send_message(notify_msg); }