]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crimson/osd: remove extraneous co_return
authorKefu Chai <k.chai@proxmox.com>
Fri, 12 Jun 2026 08:06:33 +0000 (16:06 +0800)
committerKefu Chai <k.chai@proxmox.com>
Wed, 17 Jun 2026 10:54:08 +0000 (18:54 +0800)
commit8e7fc84fef10abe1754df7515292b1352e3e7b2b
tree2879a1b1e4a824af986a3c3e3235a24a02ee1846
parent19d5e52d8bccdf10ab76011a4362dec499df4a7a
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 <k.chai@proxmox.com>
src/crimson/osd/osd.cc