[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+aCy1ETRiwzF_kmthSMY-R4Mvp4hjwhf2-vX1f=ZEv1P=yuSQ@mail.gmail.com>
Date: Sat, 9 Jul 2016 13:06:02 +0530
From: Pranay Srivastava <pranjas@...il.com>
To: Markus Pargmann <mpa@...gutronix.de>,
nbd-general@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Cc: "Pranay Kr. Srivastava" <pranaykumar.srivastava@...nizant.com>,
"Pranay Kr . Srivastava" <pranjas@...il.com>
Subject: Re: [PATCH v4 1/5]nbd: cleanup nbd_set_socket
On Thu, Jul 7, 2016 at 8:26 PM, Pranay Srivastava <pranjas@...il.com> wrote:
> On Thu, Jun 30, 2016 at 4:32 PM, Pranay Kr. Srivastava
> <pranjas@...il.com> wrote:
>> From: "Pranay Kr. Srivastava" <pranaykumar.srivastava@...nizant.com>
>>
>> This patch
>> 1) uses spin_lock instead of irq version.
>>
>> 2) removes the goto statement in case a socket
>> is already assigned with simple if-else statement.
>>
>> Signed-off-by: Pranay Kr. Srivastava <pranjas@...il.com>
>> ---
>> drivers/block/nbd.c | 15 +++++----------
>> 1 file changed, 5 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
>> index 56f7f5d..766c401 100644
>> --- a/drivers/block/nbd.c
>> +++ b/drivers/block/nbd.c
>> @@ -643,17 +643,12 @@ static int nbd_set_socket(struct nbd_device *nbd, struct socket *sock)
>> {
>> int ret = 0;
>>
>> - spin_lock_irq(&nbd->sock_lock);
>> -
>> - if (nbd->sock) {
>> + spin_lock(&nbd->sock_lock);
>> + if (nbd->sock)
>> ret = -EBUSY;
>> - goto out;
>> - }
>> -
>> - nbd->sock = sock;
>> -
>> -out:
>> - spin_unlock_irq(&nbd->sock_lock);
>> + else
>> + nbd->sock = sock;
>> + spin_unlock(&nbd->sock_lock);
>>
>> return ret;
>> }
>> --
>> 1.9.1
>>
>
> Hi Markus,
>
> Did you get a chance to review V4 of this series.
>
> --
> ---P.K.S
Ping ?
--
---P.K.S
Powered by blists - more mailing lists