[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/3] linux-aio: use LinuxAioState from the running thread
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v3 1/3] linux-aio: use LinuxAioState from the running thread |
Date: |
Fri, 28 Oct 2022 17:39:52 +0200 |
Am 28.10.2022 um 14:20 hat Emanuele Giuseppe Esposito geschrieben:
> From: Paolo Bonzini <pbonzini@redhat.com>
>
> Remove usage of aio_context_acquire by always submitting asynchronous
> AIO to the current thread's LinuxAioState.
>
> In order to prevent mistakes from the caller side, avoid passing LinuxAioState
> in laio_io_{plug/unplug} and laio_co_submit.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> @@ -354,14 +354,18 @@ static uint64_t laio_max_batch(LinuxAioState *s,
> uint64_t dev_max_batch)
> return max_batch;
> }
>
> -void laio_io_plug(BlockDriverState *bs, LinuxAioState *s)
> -{
> +void laio_io_plug(void){
The brace should be on the next line.
> + AioContext *ctx = qemu_get_current_aio_context();
> + LinuxAioState *s = aio_get_linux_aio(ctx);
> +
> s->io_q.plugged++;
> }
Kevin