]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: eliminate duplicate start_mon_command() overload
authorMax Kellermann <max.kellermann@ionos.com>
Tue, 12 Aug 2025 09:30:14 +0000 (11:30 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Wed, 15 Apr 2026 19:11:11 +0000 (21:11 +0200)
The only difference was that the first overload implied mon_rank==-1.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mon/MonClient.h

index e8e03049b2648b9703e241cbdde9c721017540ef..b02e8b19338582b2da15eb8fe63a4ef4268e9386 100644 (file)
@@ -619,31 +619,7 @@ public:
   auto start_mon_command(std::vector<std::string>&& cmd,
                          ceph::buffer::list&& inbl,
                         CompletionToken&& token) {
-    namespace asio = boost::asio;
-    ldout(cct,10) << __func__ << " cmd=" << cmd << dendl;
-    auto consigned = asio::consign(
-      std::forward<CompletionToken>(token), asio::make_work_guard(
-       asio::get_associated_executor(token, service.get_executor())));
-    return asio::async_initiate<decltype(consigned), CommandSig>(
-      [this, cmd = std::move(cmd),
-       inbl = std::move(inbl)](auto handler) mutable {
-       std::scoped_lock l(monc_lock);
-       if (!initialized || stopping) {
-         asio::dispatch(
-           asio::get_associated_immediate_executor(handler,
-                                                   service.get_executor()),
-           asio::append(std::move(handler),
-                        make_error_code(monc_errc::shutting_down),
-                        std::string{}, bufferlist{}));
-       } else {
-         auto r = new MonCommand(*this, ++last_mon_command_tid,
-                                 std::move(handler));
-         r->cmd = std::move(cmd);
-         r->inbl = std::move(inbl);
-         mon_commands.emplace(r->tid, r);
-         _send_command(r);
-       }
-      }, consigned);
+    return start_mon_command(-1, std::move(cmd), std::move(inbl), std::forward<CompletionToken>(token));
   }
 
   template<typename CompletionToken>