]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: MWatchNotify takes notifier_gid during construction.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 24 Dec 2019 12:57:23 +0000 (13:57 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 13 Feb 2020 23:11:40 +0000 (00:11 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/messages/MWatchNotify.h
src/osd/Watch.cc

index 7a31ec8c56bbfc02e6d6a09897b0cf84564b5c96..a37dc8c85a5510637ccaec74ac45d0ef80c87273 100644 (file)
@@ -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 {}
 
index 48fe50c07c1498390e37d41234898fdb6e906aff..c1e26f230c74820f9e1e03e971da3c4a82cfa59b 100644 (file)
@@ -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);
 }