[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 17/23] qcow2: Move COW and L2 update into
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 17/23] qcow2: Move COW and L2 update into own coroutine |
Date: |
Fri, 15 Feb 2013 14:01:08 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Feb 13, 2013 at 02:22:07PM +0100, Kevin Wolf wrote:
> +static bool qcow2_drain(BlockDriverState *bs)
I don't like this function name. This function is a bool query but
normal drain() means flush requests (i.e. do something that modified
state).
> +{
> + BDRVQcowState *s = bs->opaque;
> +
> + return !QLIST_EMPTY(&s->cluster_allocs);
> +}
> +
> +static inline coroutine_fn void stop_l2meta(BlockDriverState *bs)
> +{
> + BDRVQcowState *s = bs->opaque;
> +
> + qemu_co_rwlock_wrlock(&s->l2meta_flush);
> +}
> +
> +static inline coroutine_fn void resume_l2meta(BlockDriverState *bs)
> +{
> + BDRVQcowState *s = bs->opaque;
> +
> + qemu_co_rwlock_unlock(&s->l2meta_flush);
> +}
Maybe later patches will add more behavior here. I don't like wrapper
locks - it just obfuscates the locking protocol. If nothing else gets
added to these functions then it's cleaner to remove them and let code
directly lock/unlock.
- [Qemu-devel] [RFC PATCH v2 18/23] qcow2: Delay the COW, (continued)
- [Qemu-devel] [RFC PATCH v2 14/23] qcow2: Use byte granularity in qcow2_alloc_cluster_offset(), Kevin Wolf, 2013/02/13
- [Qemu-devel] [RFC PATCH v2 17/23] qcow2: Move COW and L2 update into own coroutine, Kevin Wolf, 2013/02/13
- Re: [Qemu-devel] [RFC PATCH v2 17/23] qcow2: Move COW and L2 update into own coroutine,
Stefan Hajnoczi <=
- [Qemu-devel] [RFC PATCH v2 22/23] qcow2: Move cluster gathering to a non-looping loop, Kevin Wolf, 2013/02/13
- [Qemu-devel] [RFC PATCH v2 21/23] qemu-iotests: Another concurrent multicluster allocation case, Kevin Wolf, 2013/02/13
- [Qemu-devel] [RFC PATCH v2 20/23] qcow2: Cancel COW when overwritten, Kevin Wolf, 2013/02/13
[Qemu-devel] [RFC PATCH v2 23/23] qcow2: Gather clusters in a looping loop, Kevin Wolf, 2013/02/13
Re: [Qemu-devel] [RFC PATCH v2 00/23] qcow2: Delayed COW, Stefan Hajnoczi, 2013/02/14