]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: PGMonitor: implement C_MonOp on op-related callback contexts
authorJoao Eduardo Luis <joao@suse.de>
Wed, 17 Jun 2015 10:00:19 +0000 (11:00 +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/PGMonitor.h

index 7efd8a9fe1d80eaefff133eca9a70be8c504221f..7e1602522ee5ea6822364df022bbb67f6658a5d6 100644 (file)
@@ -82,22 +82,21 @@ private:
   bool prepare_pg_stats(MonOpRequestRef op);
   void _updated_stats(MonOpRequestRef op, MonOpRequestRef ack_op);
 
-  struct C_Stats : public Context {
+  struct C_Stats : public C_MonOp {
     PGMonitor *pgmon;
-    MonOpRequestRef stats_op;
     MonOpRequestRef stats_op_ack;
     entity_inst_t who;
     C_Stats(PGMonitor *p,
             MonOpRequestRef op,
             MonOpRequestRef op_ack)
-      : pgmon(p), stats_op(op), stats_op_ack(op_ack) {}
-    void finish(int r) {
+      : C_MonOp(op), pgmon(p), stats_op_ack(op_ack) {}
+    void _finish(int r) {
       if (r >= 0) {
-       pgmon->_updated_stats(stats_op, stats_op_ack);
+       pgmon->_updated_stats(op, stats_op_ack);
       } else if (r == -ECANCELED) {
         return;
       } else if (r == -EAGAIN) {
-       pgmon->dispatch(stats_op);
+       pgmon->dispatch(op);
       } else {
        assert(0 == "bad C_Stats return value");
       }