]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: un-inline MonCommand ctor/dtor to reduce compile times 68400/head
authorMax Kellermann <max.kellermann@ionos.com>
Wed, 13 Nov 2024 17:21:49 +0000 (18:21 +0100)
committerMax Kellermann <max.kellermann@ionos.com>
Wed, 15 Apr 2026 19:12:22 +0000 (21:12 +0200)
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mon/MonClient.cc
src/mon/MonClient.h

index 05e73f4753bd571874dd557140b6eda9b65abb51..b04646bd15894510bc8e1b599fd5778e794ab5f5 100644 (file)
@@ -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<std::chrono::seconds>("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()) {
index b02e8b19338582b2da15eb8fe63a4ef4268e9386..70228404c5cadd4f705fa16bbbd60ad59ec8b33f 100644 (file)
@@ -581,21 +581,8 @@ private:
     CommandCompletion onfinish;
     std::optional<boost::asio::steady_timer> cancel_timer;
 
-    MonCommand(MonClient& monc, uint64_t t, CommandCompletion&& onfinish)
-      : tid(t), onfinish(std::move(onfinish)) {
-      auto timeout =
-          monc.cct->_conf.get_val<std::chrono::seconds>("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;