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/MgrStatMonitor.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/MgrStatMonitor.cc')
-rw-r--r-- | src/mon/MgrStatMonitor.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mon/MgrStatMonitor.cc b/src/mon/MgrStatMonitor.cc index 2668ff721b0..d4e12523b8d 100644 --- a/src/mon/MgrStatMonitor.cc +++ b/src/mon/MgrStatMonitor.cc @@ -154,7 +154,7 @@ void MgrStatMonitor::tick() bool MgrStatMonitor::preprocess_query(MonOpRequestRef op) { - auto m = static_cast<PaxosServiceMessage*>(op->get_req()); + auto m = op->get_req<PaxosServiceMessage>(); switch (m->get_type()) { case CEPH_MSG_STATFS: return preprocess_statfs(op); @@ -171,7 +171,7 @@ bool MgrStatMonitor::preprocess_query(MonOpRequestRef op) bool MgrStatMonitor::prepare_update(MonOpRequestRef op) { - auto m = static_cast<PaxosServiceMessage*>(op->get_req()); + auto m = op->get_req<PaxosServiceMessage>(); switch (m->get_type()) { case MSG_MON_MGR_REPORT: return prepare_report(op); @@ -190,7 +190,7 @@ bool MgrStatMonitor::preprocess_report(MonOpRequestRef op) bool MgrStatMonitor::prepare_report(MonOpRequestRef op) { - auto m = static_cast<MMonMgrReport*>(op->get_req()); + auto m = op->get_req<MMonMgrReport>(); bufferlist bl = m->get_data(); auto p = bl.cbegin(); decode(pending_digest, p); @@ -231,7 +231,7 @@ bool MgrStatMonitor::prepare_report(MonOpRequestRef op) bool MgrStatMonitor::preprocess_getpoolstats(MonOpRequestRef op) { op->mark_pgmon_event(__func__); - auto m = static_cast<MGetPoolStats*>(op->get_req()); + auto m = op->get_req<MGetPoolStats>(); auto session = op->get_session(); if (!session) return true; @@ -264,7 +264,7 @@ bool MgrStatMonitor::preprocess_getpoolstats(MonOpRequestRef op) bool MgrStatMonitor::preprocess_statfs(MonOpRequestRef op) { op->mark_pgmon_event(__func__); - auto statfs = static_cast<MStatfs*>(op->get_req()); + auto statfs = op->get_req<MStatfs>(); auto session = op->get_session(); if (!session) |