mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
aio-posix: unindent fdmon_io_uring_destroy()
Reduce the level of indentation to make further code changes easier to read. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20251104022933.618123-12-stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
committed by
Kevin Wolf
parent
59202c98c0
commit
a63e41f2a4
+24
-22
@@ -397,33 +397,35 @@ bool fdmon_io_uring_setup(AioContext *ctx, Error **errp)
|
||||
|
||||
void fdmon_io_uring_destroy(AioContext *ctx)
|
||||
{
|
||||
if (ctx->fdmon_ops == &fdmon_io_uring_ops) {
|
||||
AioHandler *node;
|
||||
AioHandler *node;
|
||||
|
||||
io_uring_queue_exit(&ctx->fdmon_io_uring);
|
||||
if (ctx->fdmon_ops != &fdmon_io_uring_ops) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Move handlers due to be removed onto the deleted list */
|
||||
while ((node = QSLIST_FIRST_RCU(&ctx->submit_list))) {
|
||||
unsigned flags = qatomic_fetch_and(&node->flags,
|
||||
~(FDMON_IO_URING_PENDING |
|
||||
FDMON_IO_URING_ADD |
|
||||
FDMON_IO_URING_REMOVE |
|
||||
FDMON_IO_URING_DELETE_AIO_HANDLER));
|
||||
io_uring_queue_exit(&ctx->fdmon_io_uring);
|
||||
|
||||
if ((flags & FDMON_IO_URING_REMOVE) ||
|
||||
(flags & FDMON_IO_URING_DELETE_AIO_HANDLER)) {
|
||||
QLIST_INSERT_HEAD_RCU(&ctx->deleted_aio_handlers,
|
||||
node, node_deleted);
|
||||
}
|
||||
/* Move handlers due to be removed onto the deleted list */
|
||||
while ((node = QSLIST_FIRST_RCU(&ctx->submit_list))) {
|
||||
unsigned flags = qatomic_fetch_and(&node->flags,
|
||||
~(FDMON_IO_URING_PENDING |
|
||||
FDMON_IO_URING_ADD |
|
||||
FDMON_IO_URING_REMOVE |
|
||||
FDMON_IO_URING_DELETE_AIO_HANDLER));
|
||||
|
||||
QSLIST_REMOVE_HEAD_RCU(&ctx->submit_list, node_submitted);
|
||||
if ((flags & FDMON_IO_URING_REMOVE) ||
|
||||
(flags & FDMON_IO_URING_DELETE_AIO_HANDLER)) {
|
||||
QLIST_INSERT_HEAD_RCU(&ctx->deleted_aio_handlers,
|
||||
node, node_deleted);
|
||||
}
|
||||
|
||||
g_source_remove_unix_fd(&ctx->source, ctx->io_uring_fd_tag);
|
||||
ctx->io_uring_fd_tag = NULL;
|
||||
|
||||
qemu_lockcnt_lock(&ctx->list_lock);
|
||||
fdmon_poll_downgrade(ctx);
|
||||
qemu_lockcnt_unlock(&ctx->list_lock);
|
||||
QSLIST_REMOVE_HEAD_RCU(&ctx->submit_list, node_submitted);
|
||||
}
|
||||
|
||||
g_source_remove_unix_fd(&ctx->source, ctx->io_uring_fd_tag);
|
||||
ctx->io_uring_fd_tag = NULL;
|
||||
|
||||
qemu_lockcnt_lock(&ctx->list_lock);
|
||||
fdmon_poll_downgrade(ctx);
|
||||
qemu_lockcnt_unlock(&ctx->list_lock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user