diff options
author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2005-08-09 23:07:35 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:41:44 -0400 |
commit | 6e04e02165a7209a71db553b7bc48d68421e5ebf (patch) | |
tree | 004157924013e6c099cacac59f39d3dd61f3e0e5 /include/net | |
parent | 2d8c4ce51903636ce0f60addc8134aa50ab8fa76 (diff) |
[INET]: Move tcp_port_rover to inet_hashinfo
Also expose all of the tcp_hashinfo members, i.e. killing those
tcp_ehash, etc macros, this will more clearly expose already generic
functions and some that need just a bit of work to become generic, as
we'll see in the upcoming changesets.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/inet_hashtables.h | 1 | ||||
-rw-r--r-- | include/net/sock.h | 2 | ||||
-rw-r--r-- | include/net/tcp.h | 26 |
3 files changed, 9 insertions, 20 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index da9705525f15..da07411b36d2 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -117,6 +117,7 @@ struct inet_hashinfo { | |||
117 | wait_queue_head_t lhash_wait; | 117 | wait_queue_head_t lhash_wait; |
118 | spinlock_t portalloc_lock; | 118 | spinlock_t portalloc_lock; |
119 | kmem_cache_t *bind_bucket_cachep; | 119 | kmem_cache_t *bind_bucket_cachep; |
120 | int port_rover; | ||
120 | }; | 121 | }; |
121 | 122 | ||
122 | static inline int inet_ehashfn(const __u32 laddr, const __u16 lport, | 123 | static inline int inet_ehashfn(const __u32 laddr, const __u16 lport, |
diff --git a/include/net/sock.h b/include/net/sock.h index 69d869e41c35..391d00b5b7b4 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -136,7 +136,7 @@ struct sock_common { | |||
136 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets | 136 | * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets |
137 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) | 137 | * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) |
138 | * @sk_lingertime: %SO_LINGER l_linger setting | 138 | * @sk_lingertime: %SO_LINGER l_linger setting |
139 | * @sk_hashent: hash entry in several tables (e.g. tcp_ehash) | 139 | * @sk_hashent: hash entry in several tables (e.g. inet_hashinfo.ehash) |
140 | * @sk_backlog: always used with the per-socket spinlock held | 140 | * @sk_backlog: always used with the per-socket spinlock held |
141 | * @sk_callback_lock: used with the callbacks in the end of this struct | 141 | * @sk_callback_lock: used with the callbacks in the end of this struct |
142 | * @sk_error_queue: rarely used | 142 | * @sk_error_queue: rarely used |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 9eb8ff7c911e..99e47695d4b6 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -41,19 +41,7 @@ | |||
41 | #endif | 41 | #endif |
42 | #include <linux/seq_file.h> | 42 | #include <linux/seq_file.h> |
43 | 43 | ||
44 | extern struct inet_hashinfo tcp_hashinfo; | 44 | extern struct inet_hashinfo tcp_hashinfo; |
45 | #define tcp_ehash (tcp_hashinfo.ehash) | ||
46 | #define tcp_bhash (tcp_hashinfo.bhash) | ||
47 | #define tcp_ehash_size (tcp_hashinfo.ehash_size) | ||
48 | #define tcp_bhash_size (tcp_hashinfo.bhash_size) | ||
49 | #define tcp_listening_hash (tcp_hashinfo.listening_hash) | ||
50 | #define tcp_lhash_lock (tcp_hashinfo.lhash_lock) | ||
51 | #define tcp_lhash_users (tcp_hashinfo.lhash_users) | ||
52 | #define tcp_lhash_wait (tcp_hashinfo.lhash_wait) | ||
53 | #define tcp_portalloc_lock (tcp_hashinfo.portalloc_lock) | ||
54 | #define tcp_bucket_cachep (tcp_hashinfo.bind_bucket_cachep) | ||
55 | |||
56 | extern int tcp_port_rover; | ||
57 | 45 | ||
58 | #if (BITS_PER_LONG == 64) | 46 | #if (BITS_PER_LONG == 64) |
59 | #define TCP_ADDRCMP_ALIGN_BYTES 8 | 47 | #define TCP_ADDRCMP_ALIGN_BYTES 8 |
@@ -1463,21 +1451,21 @@ extern void tcp_listen_wlock(void); | |||
1463 | 1451 | ||
1464 | /* - We may sleep inside this lock. | 1452 | /* - We may sleep inside this lock. |
1465 | * - If sleeping is not required (or called from BH), | 1453 | * - If sleeping is not required (or called from BH), |
1466 | * use plain read_(un)lock(&tcp_lhash_lock). | 1454 | * use plain read_(un)lock(&inet_hashinfo.lhash_lock). |
1467 | */ | 1455 | */ |
1468 | 1456 | ||
1469 | static inline void tcp_listen_lock(void) | 1457 | static inline void tcp_listen_lock(void) |
1470 | { | 1458 | { |
1471 | /* read_lock synchronizes to candidates to writers */ | 1459 | /* read_lock synchronizes to candidates to writers */ |
1472 | read_lock(&tcp_lhash_lock); | 1460 | read_lock(&tcp_hashinfo.lhash_lock); |
1473 | atomic_inc(&tcp_lhash_users); | 1461 | atomic_inc(&tcp_hashinfo.lhash_users); |
1474 | read_unlock(&tcp_lhash_lock); | 1462 | read_unlock(&tcp_hashinfo.lhash_lock); |
1475 | } | 1463 | } |
1476 | 1464 | ||
1477 | static inline void tcp_listen_unlock(void) | 1465 | static inline void tcp_listen_unlock(void) |
1478 | { | 1466 | { |
1479 | if (atomic_dec_and_test(&tcp_lhash_users)) | 1467 | if (atomic_dec_and_test(&tcp_hashinfo.lhash_users)) |
1480 | wake_up(&tcp_lhash_wait); | 1468 | wake_up(&tcp_hashinfo.lhash_wait); |
1481 | } | 1469 | } |
1482 | 1470 | ||
1483 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) | 1471 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) |