From: Joao Eduardo Luis Date: Wed, 10 Jun 2015 00:55:59 +0000 (+0100) Subject: mon: PaxosService: implement C_MonOp on op-related callback contexts X-Git-Tag: v9.1.0~535^2~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ed7e89a09698c0901d10e2c07fc503cbbd6718a6;p=ceph.git mon: PaxosService: implement C_MonOp on op-related callback contexts 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 --- diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index b6a16db2edf6..e89004f3c41b 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -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)