From: Sage Weil Date: Fri, 31 May 2019 14:37:35 +0000 (-0500) Subject: mon/PaxosService: add C_ReplyOp X-Git-Tag: v15.1.0~2308^2~42 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc4c31a439a2cd201d89538fd519feefeb2aeb34;p=ceph-ci.git mon/PaxosService: add C_ReplyOp Generic helper context to reply to an op on (successful) finish. Signed-off-by: Sage Weil --- diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index 36d39ad799b..bb59688594b 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -124,6 +124,20 @@ public: } }; + class C_ReplyOp : public C_MonOp { + Monitor *mon; + MonOpRequestRef op; + MessageRef reply; + public: + C_ReplyOp(PaxosService *s, MonOpRequestRef o, MessageRef r) : + C_MonOp(o), mon(s->mon), op(o), reply(r) { } + void _finish(int r) override { + if (r >= 0) { + mon->send_reply(op, reply.detach()); + } + } + }; + /** * @} */