Re: [RFC 1/2] Bluetooth: Create chan->ops->set_err()

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

 



Hi,

On Thu, May 24, 2012 at 10:18:07AM -0700, Mat Martineau wrote:
> >>On Thu, May 24, 2012 at 04:00:16AM -0300, Gustavo Padovan wrote:
> >>>-	lock_sock(sk);
> >>>-	__l2cap_state_change(chan, BT_DISCONN);
> >>>-	__l2cap_chan_set_err(chan, err);
> >>>-	release_sock(sk);
> >>>+	l2cap_state_change(chan, BT_DISCONN);
> >>>+	if(chan->ops->set_err)
> >>>+		chan->ops->set_err(chan->data, err);
> >>
> >>I do not know can it be done somehow better, currently we lock and unlock
> >>sockets for each operation.
> >
> >I'm having trouble to get your point, could you please explain?
> 
> What I see is that the lock used to be acquired once, with both
> state_change and set_err happening while locked.  With this change,
> the lock is acquired twice, once for state_change and once for
> set_err.  I'm not sure it's good to release the lock between
> state_change and set_err.

Maybe we add parameter err to l2cap_state_change and if set set error.

Then we do not lock/unlock for each operation.

Best regards 
Andrei Emeltchenko 
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux