[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/12] file-posix: remove incorrect coroutine_fn calls
From: |
Eric Blake |
Subject: |
Re: [PATCH 01/12] file-posix: remove incorrect coroutine_fn calls |
Date: |
Thu, 1 Jun 2023 08:50:48 -0500 |
User-agent: |
NeoMutt/20230517 |
On Thu, Jun 01, 2023 at 01:51:34PM +0200, Paolo Bonzini wrote:
> raw_co_getlength is called by handle_aiocb_write_zeroes, which is not a
> coroutine
> function. This is harmless because raw_co_getlength does not actually
> suspend,
> but in the interest of clarity make it a non-coroutine_fn that is just wrapped
> by the coroutine_fn raw_co_getlength. Likewise, check_cache_dropped was only
> a coroutine_fn because it called raw_co_getlength, so it can be made
> non-coroutine
> as well.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> block/file-posix.c | 29 +++++++++++++++++------------
> 1 file changed, 17 insertions(+), 12 deletions(-)
>
> @@ -2696,7 +2696,7 @@ static int coroutine_fn
> raw_co_truncate(BlockDriverState *bs, int64_t offset,
> }
>
> if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) {
> - int64_t cur_length = raw_co_getlength(bs);
> + int64_t cur_length = raw_getlength(bs);
Shouldn't this one still call the raw_co_getlength() wrapper?
> @@ -3245,7 +3250,7 @@ static int coroutine_fn
> raw_co_block_status(BlockDriverState *bs,
> * round up if necessary.
> */
> if (!QEMU_IS_ALIGNED(*pnum, bs->bl.request_alignment)) {
> - int64_t file_length = raw_co_getlength(bs);
> + int64_t file_length = raw_getlength(bs);
Likewise this one?
>
> static bool coroutine_fn cdrom_co_is_inserted(BlockDriverState *bs)
> {
> - return raw_co_getlength(bs) > 0;
> + return raw_getlength(bs) > 0;
> }
and this one?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [PATCH 00/12] block: more fixes to coroutine_fn marking, Paolo Bonzini, 2023/06/01
- [PATCH 01/12] file-posix: remove incorrect coroutine_fn calls, Paolo Bonzini, 2023/06/01
- Re: [PATCH 01/12] file-posix: remove incorrect coroutine_fn calls,
Eric Blake <=
- [PATCH 02/12] qed: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 05/12] block: mark another function as coroutine_fns and GRAPH_UNLOCKED, Paolo Bonzini, 2023/06/01
- [PATCH 06/12] cloop: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 03/12] vpc: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 04/12] bochs: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 08/12] vmdk: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 07/12] dmg: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 10/12] qcow2: mark more functions as coroutine_fns and GRAPH_RDLOCK, Paolo Bonzini, 2023/06/01
- [PATCH 11/12] block: use bdrv_co_getlength in coroutine context, Paolo Bonzini, 2023/06/01