Difference between revisions of "Kernel code quotes"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
(Added sk_hashed and fixed code->pre)
m (Add them upside-down to make new quotes appear at the top)
Line 3: Line 3:
 
----
 
----
 
<pre>
 
<pre>
Instead of using a dedicated spinlock, we (ab)use inetsw_lock
+
static inline int sk_hashed(const struct sock *sk)
 +
{
 +
        return !sk_unhashed(sk);
 +
}
 
</pre>
 
</pre>
  
:''from linux-2.6.23/net/ipv4/af_inet.c:build_ehash_secret()''
+
:''from linux-2.6.23/include/net/sock.h''
  
 
----
 
----
 
<pre>
 
<pre>
static inline int sk_hashed(const struct sock *sk)
+
Instead of using a dedicated spinlock, we (ab)use inetsw_lock
{
 
        return !sk_unhashed(sk);
 
}
 
 
</pre>
 
</pre>
  
:''from linux-2.6.23/include/net/sock.h''
+
:''from linux-2.6.23/net/ipv4/af_inet.c:build_ehash_secret()''
  
 
[[Category: Kernel]]
 
[[Category: Kernel]]

Revision as of 07:39, 7 November 2007

Here we're collecting some funny quotes from the linux kernel code


static inline int sk_hashed(const struct sock *sk)
{
        return !sk_unhashed(sk);
}
from linux-2.6.23/include/net/sock.h

Instead of using a dedicated spinlock, we (ab)use inetsw_lock
from linux-2.6.23/net/ipv4/af_inet.c:build_ehash_secret()