]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: PaxosService: implement C_MonOp on op-related callback contexts
authorJoao Eduardo Luis <joao@suse.de>
Wed, 10 Jun 2015 00:55:59 +0000 (01:55 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 16 Jul 2015 17:06:07 +0000 (18:06 +0100)
These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/PaxosService.h

index b6a16db2edf622088c3126c71eac9a3d2fb15c60..e89004f3c41bb8b803c8ad8c25e39f1621e1c26c 100644 (file)
@@ -102,12 +102,12 @@ protected:
    * instance of this class onto the Paxos::wait_for_readable function, and
    * we will retry the whole dispatch again once the callback is fired.
    */
-  class C_RetryMessage : public Context {
+  class C_RetryMessage : public C_MonOp {
     PaxosService *svc;
-    MonOpRequestRef op;
   public:
-    C_RetryMessage(PaxosService *s, MonOpRequestRef op_) : svc(s), op(op_) {}
-    void finish(int r) {
+    C_RetryMessage(PaxosService *s, MonOpRequestRef op_) :
+      C_MonOp(op_), svc(s) { }
+    void _finish(int r) {
       if (r == -EAGAIN || r >= 0)
        svc->dispatch(op);
       else if (r == -ECANCELED)