From: Michal Jarzabek Date: Fri, 12 Aug 2016 19:37:01 +0000 (+0100) Subject: mon/PGMonitor: move C_Stats struct to cc file X-Git-Tag: ses5-milestone5~126^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ca6cc22001f3b16b8b62a054fd9404b46dfd282;p=ceph.git mon/PGMonitor: move C_Stats struct to cc file Signed-off-by: Michal Jarzabek --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index b6ad175bf4f7..a9e1f16627dc 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -740,6 +740,27 @@ bool PGMonitor::pg_stats_have_changed(int from, const MPGStats *stats) const return false; } +struct PGMonitor::C_Stats : public C_MonOp { + PGMonitor *pgmon; + MonOpRequestRef stats_op_ack; + entity_inst_t who; + C_Stats(PGMonitor *p, + MonOpRequestRef op, + MonOpRequestRef op_ack) + : C_MonOp(op), pgmon(p), stats_op_ack(op_ack) {} + void _finish(int r) { + if (r >= 0) { + pgmon->_updated_stats(op, stats_op_ack); + } else if (r == -ECANCELED) { + return; + } else if (r == -EAGAIN) { + pgmon->dispatch(op); + } else { + assert(0 == "bad C_Stats return value"); + } + } +}; + bool PGMonitor::prepare_pg_stats(MonOpRequestRef op) { op->mark_pgmon_event(__func__); diff --git a/src/mon/PGMonitor.h b/src/mon/PGMonitor.h index c2b917b63aa6..bdce70c5b982 100644 --- a/src/mon/PGMonitor.h +++ b/src/mon/PGMonitor.h @@ -78,26 +78,7 @@ private: bool prepare_pg_stats(MonOpRequestRef op); void _updated_stats(MonOpRequestRef op, MonOpRequestRef ack_op); - struct C_Stats : public C_MonOp { - PGMonitor *pgmon; - MonOpRequestRef stats_op_ack; - entity_inst_t who; - C_Stats(PGMonitor *p, - MonOpRequestRef op, - MonOpRequestRef op_ack) - : C_MonOp(op), pgmon(p), stats_op_ack(op_ack) {} - void _finish(int r) { - if (r >= 0) { - pgmon->_updated_stats(op, stats_op_ack); - } else if (r == -ECANCELED) { - return; - } else if (r == -EAGAIN) { - pgmon->dispatch(op); - } else { - assert(0 == "bad C_Stats return value"); - } - } - }; + struct C_Stats; void handle_statfs(MonOpRequestRef op); bool preprocess_getpoolstats(MonOpRequestRef op);