public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* socket locking obscure code
@ 2007-09-01  4:50 Cyrill Gorcunov
  0 siblings, 0 replies; only message in thread
From: Cyrill Gorcunov @ 2007-09-01  4:50 UTC (permalink / raw)
  To: LKML

Hi LKML,
 
looking thru lock_sock_nested (while trying to catch
BUG in CIFS as reported on bugzilla #8377) I found
that lock_sock_nested consist of:

void fastcall lock_sock_nested(struct sock *sk, int subclass)
{
	might_sleep();
--->	spin_lock_bh(&sk->sk_lock.slock);
	if (sk->sk_lock.owner)
		__lock_sock(sk);
	sk->sk_lock.owner = (void *)1;
--->	spin_unlock(&sk->sk_lock.slock);
	/*
	 * The sk_lock has mutex_lock() semantics here:
	 */
	mutex_acquire(&sk->sk_lock.dep_map, subclass, 0, _RET_IP_);
	local_bh_enable();
}
 
so why spin_unlock are there instead of spin_unlock_bh?
To recope with __lock_sock? Am I right?
 
 		Cyrill
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-01  4:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-01  4:50 socket locking obscure code Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox