qemu-devel
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]