]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: get rid of AIO_STATE_CALLBACK in AioCompletion 58591/head
authorIlya Dryomov <idryomov@gmail.com>
Mon, 15 Jul 2024 09:39:11 +0000 (11:39 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 17 Jul 2024 08:13:53 +0000 (10:13 +0200)
commitf6e65edf9b493e8f778d2531397ceddc32efb098
treefbf46a46d62a005401ef701456fd0c1956e3675a
parented082dbd127152ddd7b41c1972c21b87a4a2818c
librbd: get rid of AIO_STATE_CALLBACK in AioCompletion

After commit 002afa0fe375 ("librbd: avoid using lock within AIO
completion where possible"), the only method whose behavior would
change if AIO_STATE_CALLBACK is removed is is_complete() and it
actually needs fixing anyway: because of state != AIO_STATE_PENDING
test, is_complete() returns true both for AIO_STATE_CALLBACK and
AIO_STATE_COMPLETE, while wait_for_complete() still blocks on
AIO_STATE_CALLBACK and returns only on AIO_STATE_COMPLETE.  These
methods back public APIs, so this inconsistency is exposed to users.

If we move to setting state to AIO_STATE_COMPLETE at the top of
mark_complete_and_notify() (i.e. before event socket notification), the
transient state for callbacks can be eliminated entirely and the
inconsistency goes away.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/librbd/io/AioCompletion.cc
src/librbd/io/AioCompletion.h