]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Paxos: have wait_for_* functions requiring ops
authorJoao Eduardo Luis <joao@suse.de>
Fri, 12 Jun 2015 18:20:32 +0000 (19:20 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 16 Jul 2015 17:06:07 +0000 (18:06 +0100)
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/Paxos.h

index 2fe6403d59492e8775cf898437d16907d7357a5b..9b9a732dbbcb9fe50dcec9c3d9b300aee397ffbc 100644 (file)
@@ -1226,9 +1226,15 @@ public:
    *
    * @param c A callback
    */
-  void wait_for_active(Context *c) {
+  void wait_for_active(MonOpRequestRef op, Context *c) {
+    if (op)
+      op->mark_event("paxos:wait_for_active");
     waiting_for_active.push_back(c);
   }
+  void wait_for_active(Context *c) {
+    MonOpRequestRef o;
+    wait_for_active(o, c);
+  }
 
   /**
    * Trim the Paxos state as much as we can.
@@ -1304,10 +1310,16 @@ public:
    *
    * @param onreadable A callback
    */
-  void wait_for_readable(Context *onreadable) {
+  void wait_for_readable(MonOpRequestRef op, Context *onreadable) {
     assert(!is_readable());
+    if (op)
+      op->mark_event("paxos:wait_for_readable");
     waiting_for_readable.push_back(onreadable);
   }
+  void wait_for_readable(Context *onreadable) {
+    MonOpRequestRef o;
+    wait_for_readable(o, onreadable);
+  }
   /**
    * @}
    */
@@ -1340,10 +1352,16 @@ public:
    *
    * @param c A callback
    */
-  void wait_for_writeable(Context *c) {
+  void wait_for_writeable(MonOpRequestRef op, Context *c) {
     assert(!is_writeable());
+    if (op)
+      op->mark_event("paxos:wait_for_writeable");
     waiting_for_writeable.push_back(c);
   }
+  void wait_for_writeable(Context *c) {
+    MonOpRequestRef o;
+    wait_for_writeable(o, c);
+  }
 
   /**
    * Get a transaction to submit operations to propose against