aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-08-09 23:09:46 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:42:18 -0400
commite48c414ee61f4ac8d5cff2973e66a7cbc8a93aa5 (patch)
treec4656efe48b75adf5742514c3e4286007f20bdca /include/net/sock.h
parent8feaf0c0a5488b3d898a9c207eb6678f44ba3f26 (diff)
[INET]: Generalise the TCP sock ID lookup routines
And also some TIME_WAIT functions. [acme@toy net-2.6.14]$ grep built-in /tmp/before.size /tmp/after.size /tmp/before.size: 282955 13122 9312 305389 4a8ed net/ipv4/built-in.o /tmp/after.size: 281566 13122 9312 304000 4a380 net/ipv4/built-in.o [acme@toy net-2.6.14]$ I kept them still inlined, will uninline at some point to see what would be the performance difference. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index c902c57bf2b7..bdae0a5eadf5 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -255,28 +255,28 @@ struct sock {
255/* 255/*
256 * Hashed lists helper routines 256 * Hashed lists helper routines
257 */ 257 */
258static inline struct sock *__sk_head(struct hlist_head *head) 258static inline struct sock *__sk_head(const struct hlist_head *head)
259{ 259{
260 return hlist_entry(head->first, struct sock, sk_node); 260 return hlist_entry(head->first, struct sock, sk_node);
261} 261}
262 262
263static inline struct sock *sk_head(struct hlist_head *head) 263static inline struct sock *sk_head(const struct hlist_head *head)
264{ 264{
265 return hlist_empty(head) ? NULL : __sk_head(head); 265 return hlist_empty(head) ? NULL : __sk_head(head);
266} 266}
267 267
268static inline struct sock *sk_next(struct sock *sk) 268static inline struct sock *sk_next(const struct sock *sk)
269{ 269{
270 return sk->sk_node.next ? 270 return sk->sk_node.next ?
271 hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL; 271 hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL;
272} 272}
273 273
274static inline int sk_unhashed(struct sock *sk) 274static inline int sk_unhashed(const struct sock *sk)
275{ 275{
276 return hlist_unhashed(&sk->sk_node); 276 return hlist_unhashed(&sk->sk_node);
277} 277}
278 278
279static inline int sk_hashed(struct sock *sk) 279static inline int sk_hashed(const struct sock *sk)
280{ 280{
281 return sk->sk_node.pprev != NULL; 281 return sk->sk_node.pprev != NULL;
282} 282}
@@ -494,7 +494,7 @@ extern int sk_wait_data(struct sock *sk, long *timeo);
494struct request_sock_ops; 494struct request_sock_ops;
495 495
496/* Here is the right place to enable sock refcounting debugging */ 496/* Here is the right place to enable sock refcounting debugging */
497#define SOCK_REFCNT_DEBUG 497//#define SOCK_REFCNT_DEBUG
498 498
499/* Networking protocol blocks we attach to sockets. 499/* Networking protocol blocks we attach to sockets.
500 * socket layer -> transport layer interface 500 * socket layer -> transport layer interface