]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/mon_types: move C_MonOp to MonOpRequest.h
authorSage Weil <sage@redhat.com>
Tue, 30 May 2017 19:38:04 +0000 (15:38 -0400)
committerSage Weil <sage@redhat.com>
Thu, 1 Jun 2017 17:58:23 +0000 (13:58 -0400)
Fixes a circular #include of
 mon_types -> MonOpRequest -> Session -> mon_types

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonOpRequest.h
src/mon/mon_types.h

index bd85f11f68374812aad41263ae18b456b7098615..a5000efe44e23bcc418cb6f5175f4c62a045ff56 100644 (file)
@@ -218,4 +218,30 @@ public:
 
 typedef MonOpRequest::Ref MonOpRequestRef;
 
+struct C_MonOp : public Context
+{
+  MonOpRequestRef op;
+
+  explicit C_MonOp(MonOpRequestRef o) :
+    op(o) { }
+
+  void finish(int r) override {
+    if (op && r == -ECANCELED) {
+      op->mark_event("callback canceled");
+    } else if (op && r == -EAGAIN) {
+      op->mark_event("callback retry");
+    } else if (op && r == 0) {
+      op->mark_event("callback finished");
+    }
+    _finish(r);
+  }
+
+  void mark_op_event(const string &event) {
+    if (op)
+      op->mark_event_string(event);
+  }
+
+  virtual void _finish(int r) = 0;
+};
+
 #endif /* MON_OPREQUEST_H_ */
index c34e87268f9b9e534a7fa2e060b4c227ce82a209..54bbfb336d06eb5cb324719fc678430da4622e54 100644 (file)
@@ -20,7 +20,6 @@
 #include "common/Formatter.h"
 #include "common/bit_str.h"
 #include "include/Context.h"
-#include "mon/MonOpRequest.h"
 
 #define PAXOS_PGMAP      0  // before osd, for pg kick to behave
 #define PAXOS_MDSMAP     1
@@ -211,32 +210,6 @@ static inline ostream& operator<<(ostream& out, const ScrubResult& r) {
 /// for information like os, kernel, hostname, memory info, cpu model.
 typedef map<string, string> Metadata;
 
-struct C_MonOp : public Context
-{
-  MonOpRequestRef op;
-
-  explicit C_MonOp(MonOpRequestRef o) :
-    op(o) { }
-
-  void finish(int r) override {
-    if (op && r == -ECANCELED) {
-      op->mark_event("callback canceled");
-    } else if (op && r == -EAGAIN) {
-      op->mark_event("callback retry");
-    } else if (op && r == 0) {
-      op->mark_event("callback finished");
-    }
-    _finish(r);
-  }
-
-  void mark_op_event(const string &event) {
-    if (op)
-      op->mark_event_string(event);
-  }
-
-  virtual void _finish(int r) = 0;
-};
-
 namespace ceph {
   namespace features {
     namespace mon {