From: Max Kellermann Date: Tue, 12 Aug 2025 09:30:14 +0000 (+0200) Subject: mon/MonClient: eliminate duplicate start_mon_command() overload X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e503c8935c671bfca3578150efbcc469c102b08;p=ceph.git mon/MonClient: eliminate duplicate start_mon_command() overload The only difference was that the first overload implied mon_rank==-1. Signed-off-by: Max Kellermann --- diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index e8e03049b264..b02e8b193385 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -619,31 +619,7 @@ public: auto start_mon_command(std::vector&& cmd, ceph::buffer::list&& inbl, CompletionToken&& token) { - namespace asio = boost::asio; - ldout(cct,10) << __func__ << " cmd=" << cmd << dendl; - auto consigned = asio::consign( - std::forward(token), asio::make_work_guard( - asio::get_associated_executor(token, service.get_executor()))); - return asio::async_initiate( - [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(token)); } template