From: Kefu Chai Date: Fri, 12 Jun 2026 08:36:32 +0000 (+0800) Subject: crimson/osd: use std::unique_lock when appropriate X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=17c6e03f17f464b3c94e8e0f45c34e09746cbab7;p=ceph.git crimson/osd: use std::unique_lock when appropriate instead of lock and unlock a mutex manually, let's use the RAII helper. simpler this way. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 63b5d4901cc2..0030e04a781b 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -1187,11 +1187,8 @@ seastar::future<> OSD::handle_osd_map(Ref m) * See https://tracker.ceph.com/issues/59165 */ ceph_assert(seastar::this_shard_id() == PRIMARY_CORE); - return handle_osd_map_lock.lock().then([this, m] { - return _handle_osd_map(m); - }).finally([this] { - return handle_osd_map_lock.unlock(); - }); + const auto lock = co_await seastar::get_unique_lock(handle_osd_map_lock); + co_await _handle_osd_map(m); } seastar::future<> OSD::_handle_osd_map(Ref m)