qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/4] block/iscsi.c: Use lock guard macros


From: Kevin Wolf
Subject: Re: [PATCH 4/4] block/iscsi.c: Use lock guard macros
Date: Wed, 2 Dec 2020 12:11:42 +0100

Am 09.11.2020 um 16:43 hat Gan Qixin geschrieben:
> Replace manual lock()/unlock() calls with lock guard macros
> (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/iscsi.c.
> 
> Signed-off-by: Gan Qixin <ganqixin@huawei.com>
> ---
>  block/iscsi.c | 28 +++++++++++++---------------
>  1 file changed, 13 insertions(+), 15 deletions(-)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index e30a7e3606..f5f657b582 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -322,7 +322,7 @@ iscsi_aio_cancel(BlockAIOCB *blockacb)
>      IscsiAIOCB *acb = (IscsiAIOCB *)blockacb;
>      IscsiLun *iscsilun = acb->iscsilun;
>  
> -    qemu_mutex_lock(&iscsilun->mutex);
> +    QEMU_LOCK_GUARD(&iscsilun->mutex);
>  
>      /* If it was cancelled or completed already, our work is done here */
>      if (acb->cancelled || acb->status != -EINPROGRESS) {
           qemu_mutex_unlock(&iscsilun->mutex);
           return;
       }

I don't think this qemu_mutex_unlock() is right any more now.

Kevin




reply via email to

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