]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages/MPGCreated: add MPGCreated
authorKefu Chai <kchai@redhat.com>
Sat, 11 Mar 2017 14:50:50 +0000 (22:50 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 30 Mar 2017 12:21:17 +0000 (20:21 +0800)
add a new message type MPGCreated. osd is supposed to send this message
to monitor to inform that any pg(s) is created and activated.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/messages/MOSDPGCreated.h [new file with mode: 0644]
src/msg/Message.cc
src/msg/Message.h

diff --git a/src/messages/MOSDPGCreated.h b/src/messages/MOSDPGCreated.h
new file mode 100644 (file)
index 0000000..13ec10f
--- /dev/null
@@ -0,0 +1,32 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+#include "osd/osd_types.h"
+#include "messages/PaxosServiceMessage.h"
+
+class MOSDPGCreated : public PaxosServiceMessage {
+public:
+  pg_t pgid;
+  MOSDPGCreated()
+    : PaxosServiceMessage(MSG_OSD_PG_CREATED, 0)
+  {}
+  MOSDPGCreated(pg_t pgid)
+    : PaxosServiceMessage(MSG_OSD_PG_CREATED, 0),
+      pgid(pgid)
+  {}
+  const char *get_type_name() const override { return "pg_created"; }
+  void print(ostream& out) const override {
+    out << "osd_pg_created(" << pgid << ")";
+  }
+  void encode_payload(uint64_t features) override {
+    paxos_encode();
+    ::encode(pgid, payload);
+  }
+  void decode_payload() override {
+    auto p = payload.begin();
+    paxos_decode(p);
+    ::decode(pgid, p);
+  }
+};
index 8b5cb0a98f0c37f5568b0bcd336409831053a526..c80ddf0fe00f3b5920ca8fb0a5e2fed28b6c635c 100644 (file)
@@ -72,6 +72,7 @@ using namespace std;
 #include "messages/MOSDMap.h"
 #include "messages/MMonGetOSDMap.h"
 
+#include "messages/MOSDPGCreated.h"
 #include "messages/MOSDPGNotify.h"
 #include "messages/MOSDPGQuery.h"
 #include "messages/MOSDPGLog.h"
@@ -462,6 +463,9 @@ Message *decode_message(CephContext *cct, int crcflags,
   case MSG_OSD_REPOPREPLY:
     m = new MOSDRepOpReply();
     break;
+  case MSG_OSD_PG_CREATED:
+    m = new MOSDPGCreated();
+    break;
   case MSG_OSD_PG_UPDATE_LOG_MISSING:
     m = new MOSDPGUpdateLogMissing();
     break;
index da35ce08ef2ba5000656f08f36fd0a920559d22f..a3c3ffa4b0707ea49d07afdb636fb69f2d6c5e14 100644 (file)
 #define MSG_OSD_PG_UPDATE_LOG_MISSING  114
 #define MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY  115
 
+#define MSG_OSD_PG_CREATED      116
 
 // *** MDS ***