Subject: Re: [PATCH net-next 1/2] tipc: Don't use iocb argument in socket layer

From: Ying Xue <[email-masked]>
Date: Sat, 28 Feb 2015 10:29:19 +0800

On 02/27/2015 09:30 PM, Jon Maloy wrote:
>> > socket *sock, long *timeo_p)  static int tipc_sendmsg(struct kiocb *iocb,
>> > struct socket *sock,
>> >  			struct msghdr *m, size_t dsz)
>> >  {
>> > +	struct sock *sk = sock->sk;
>> > +	int ret;
> alternative method: 
> 
>                 bool has_lock = false;
>> > +
>> > +	lock_sock(sk);
> 
>              if (!owned_by_user(sk) {
>                             lock_sock(sk);
>                             has_lock = true;
>               }      
>> > +	ret = __tipc_sendmsg(sock, m, dsz);
>               [expand  code here, instead of an extra call]
> 
>               if (has_lock))
>                       release_sock();
> 
> Not sure what I prefer, but I just wanted to indicate
> this option.
> 

Thanks! In my opinion, the current version seems more clear. :)

> You can anyway add a "Reviewed-by" from me.

Regards,
Ying