diff options
author | Kefu Chai <kchai@redhat.com> | 2019-08-30 08:03:06 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2019-08-30 08:27:25 +0200 |
commit | 25d78984f7acc8908c5895bbe23d2bd7bfbbdb51 (patch) | |
tree | 1d951d903aa8d1047374a0631aff1015f2af63ef /src/mon/HealthMonitor.cc | |
parent | Merge pull request #29939 from majianpeng/bluestore-print-correctly-info (diff) | |
download | ceph-25d78984f7acc8908c5895bbe23d2bd7bfbbdb51.tar.xz ceph-25d78984f7acc8908c5895bbe23d2bd7bfbbdb51.zip |
mon: use get_req<> instead of static_cast<>(get_req())
less repeating, better readability
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/mon/HealthMonitor.cc')
-rw-r--r-- | src/mon/HealthMonitor.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mon/HealthMonitor.cc b/src/mon/HealthMonitor.cc index c6029b415d3..ca038a05565 100644 --- a/src/mon/HealthMonitor.cc +++ b/src/mon/HealthMonitor.cc @@ -167,7 +167,7 @@ version_t HealthMonitor::get_trim_to() const bool HealthMonitor::preprocess_query(MonOpRequestRef op) { - PaxosServiceMessage *m = static_cast<PaxosServiceMessage*>(op->get_req()); + auto m = op->get_req<PaxosServiceMessage>(); switch (m->get_type()) { case MSG_MON_COMMAND: return preprocess_command(op); @@ -197,7 +197,7 @@ bool HealthMonitor::prepare_update(MonOpRequestRef op) bool HealthMonitor::preprocess_command(MonOpRequestRef op) { - MMonCommand *m = static_cast<MMonCommand*>(op->get_req()); + auto m = op->get_req<MMonCommand>(); std::stringstream ss; bufferlist rdata; @@ -229,7 +229,7 @@ bool HealthMonitor::preprocess_command(MonOpRequestRef op) bool HealthMonitor::prepare_command(MonOpRequestRef op) { - MMonCommand *m = static_cast<MMonCommand*>(op->get_req()); + auto m = op->get_req<MMonCommand>(); std::stringstream ss; bufferlist rdata; @@ -330,7 +330,7 @@ out: bool HealthMonitor::prepare_health_checks(MonOpRequestRef op) { - MMonHealthChecks *m = static_cast<MMonHealthChecks*>(op->get_req()); + auto m = op->get_req<MMonHealthChecks>(); // no need to check if it's changed, the peon has done so quorum_checks[m->get_source().num()] = std::move(m->health_checks); return true; |