From: Max Kellermann Date: Wed, 13 Nov 2024 17:21:49 +0000 (+0100) Subject: mon/MonClient: un-inline MonCommand ctor/dtor to reduce compile times X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F68400%2Fhead;p=ceph.git mon/MonClient: un-inline MonCommand ctor/dtor to reduce compile times Signed-off-by: Max Kellermann --- diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 05e73f4753bd..b04646bd1589 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -1174,6 +1174,24 @@ int MonClient::wait_auth_rotating(double timeout) // --------- +MonClient::MonCommand::MonCommand(MonClient& monc, uint64_t t, CommandCompletion&& onfinish) + : tid(t), onfinish(std::move(onfinish)) { + auto timeout = + monc.cct->_conf.get_val("rados_mon_op_timeout"); + if (timeout.count() > 0) { + cancel_timer.emplace(monc.service, timeout); + cancel_timer->async_wait( + [this, &monc](boost::system::error_code ec) { + if (ec) + return; + std::scoped_lock l(monc.monc_lock); + monc._cancel_mon_command(tid); + }); + } +} + +MonClient::MonCommand::~MonCommand() = default; + void MonClient::_send_command(MonCommand *r) { if (r->is_tell()) { diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index b02e8b193385..70228404c5ca 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -581,21 +581,8 @@ private: CommandCompletion onfinish; std::optional cancel_timer; - MonCommand(MonClient& monc, uint64_t t, CommandCompletion&& onfinish) - : tid(t), onfinish(std::move(onfinish)) { - auto timeout = - monc.cct->_conf.get_val("rados_mon_op_timeout"); - if (timeout.count() > 0) { - cancel_timer.emplace(monc.service, timeout); - cancel_timer->async_wait( - [this, &monc](boost::system::error_code ec) { - if (ec) - return; - std::scoped_lock l(monc.monc_lock); - monc._cancel_mon_command(tid); - }); - } - } + MonCommand(MonClient& monc, uint64_t t, CommandCompletion&& onfinish); + ~MonCommand(); bool is_tell() const { return target_name.size() || target_rank >= 0;