From: Kefu Chai Date: Fri, 12 Jun 2026 08:06:33 +0000 (+0800) Subject: crimson/osd: remove extraneous co_return X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8e7fc84fef10abe1754df7515292b1352e3e7b2b;p=ceph.git crimson/osd: remove extraneous co_return no need to use co_return at the end of a coroutine which returns future<>. despite that this does not incur performance penalty, because: co_await func() // func returns future<> returns void co_return is called with void operand, this statement is lowered to promise.return_void() and a bare "co_await func()" also calls return_void(). so they are equivalent at runtime. but the extraneous co_return can be dispensed. also take this opportunity to remove the bare co_return at the end of a coroutine. it's unnecessary just like a `return` at the end of a function returning `void`. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index d742eef94be..55e01cabef4 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -344,7 +344,6 @@ seastar::future<> OSD::mkfs( co_await store.umount(); co_await store.stop(); - co_return; } seastar::future<> OSD::_write_superblock( @@ -712,7 +711,7 @@ seastar::future<> OSD::_send_boot() if (ret == 0) { m->metadata["osd_objectstore"] = type; } - co_return co_await monc->send_message(std::move(m)); + co_await monc->send_message(std::move(m)); } seastar::future<> OSD::_add_device_class() @@ -744,8 +743,6 @@ seastar::future<> OSD::_add_device_class() } else { INFO("device_class was set: {}", message); } - - co_return; } seastar::future<> OSD::_add_me_to_crush()