aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_minisocks.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-08-09 23:07:35 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:41:44 -0400
commit6e04e02165a7209a71db553b7bc48d68421e5ebf (patch)
tree004157924013e6c099cacac59f39d3dd61f3e0e5 /net/ipv4/tcp_minisocks.c
parent2d8c4ce51903636ce0f60addc8134aa50ab8fa76 (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 'net/ipv4/tcp_minisocks.c')
-rw-r--r--net/ipv4/tcp_minisocks.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 267cea1087e5..f29e2f6ebe1b 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -60,12 +60,11 @@ int tcp_tw_count;
60/* Must be called with locally disabled BHs. */ 60/* Must be called with locally disabled BHs. */
61static void tcp_timewait_kill(struct tcp_tw_bucket *tw) 61static void tcp_timewait_kill(struct tcp_tw_bucket *tw)
62{ 62{
63 struct inet_ehash_bucket *ehead;
64 struct inet_bind_hashbucket *bhead; 63 struct inet_bind_hashbucket *bhead;
65 struct inet_bind_bucket *tb; 64 struct inet_bind_bucket *tb;
66
67 /* Unlink from established hashes. */ 65 /* Unlink from established hashes. */
68 ehead = &tcp_ehash[tw->tw_hashent]; 66 struct inet_ehash_bucket *ehead = &tcp_hashinfo.ehash[tw->tw_hashent];
67
69 write_lock(&ehead->lock); 68 write_lock(&ehead->lock);
70 if (hlist_unhashed(&tw->tw_node)) { 69 if (hlist_unhashed(&tw->tw_node)) {
71 write_unlock(&ehead->lock); 70 write_unlock(&ehead->lock);
@@ -76,12 +75,12 @@ static void tcp_timewait_kill(struct tcp_tw_bucket *tw)
76 write_unlock(&ehead->lock); 75 write_unlock(&ehead->lock);
77 76
78 /* Disassociate with bind bucket. */ 77 /* Disassociate with bind bucket. */
79 bhead = &tcp_bhash[inet_bhashfn(tw->tw_num, tcp_bhash_size)]; 78 bhead = &tcp_hashinfo.bhash[inet_bhashfn(tw->tw_num, tcp_hashinfo.bhash_size)];
80 spin_lock(&bhead->lock); 79 spin_lock(&bhead->lock);
81 tb = tw->tw_tb; 80 tb = tw->tw_tb;
82 __hlist_del(&tw->tw_bind_node); 81 __hlist_del(&tw->tw_bind_node);
83 tw->tw_tb = NULL; 82 tw->tw_tb = NULL;
84 inet_bind_bucket_destroy(tcp_bucket_cachep, tb); 83 inet_bind_bucket_destroy(tcp_hashinfo.bind_bucket_cachep, tb);
85 spin_unlock(&bhead->lock); 84 spin_unlock(&bhead->lock);
86 85
87#ifdef SOCK_REFCNT_DEBUG 86#ifdef SOCK_REFCNT_DEBUG
@@ -297,13 +296,13 @@ kill:
297static void __tcp_tw_hashdance(struct sock *sk, struct tcp_tw_bucket *tw) 296static void __tcp_tw_hashdance(struct sock *sk, struct tcp_tw_bucket *tw)
298{ 297{
299 const struct inet_sock *inet = inet_sk(sk); 298 const struct inet_sock *inet = inet_sk(sk);
300 struct inet_ehash_bucket *ehead = &tcp_ehash[sk->sk_hashent]; 299 struct inet_ehash_bucket *ehead = &tcp_hashinfo.ehash[sk->sk_hashent];
301 struct inet_bind_hashbucket *bhead; 300 struct inet_bind_hashbucket *bhead;
302 /* Step 1: Put TW into bind hash. Original socket stays there too. 301 /* Step 1: Put TW into bind hash. Original socket stays there too.
303 Note, that any socket with inet->num != 0 MUST be bound in 302 Note, that any socket with inet->num != 0 MUST be bound in
304 binding cache, even if it is closed. 303 binding cache, even if it is closed.
305 */ 304 */
306 bhead = &tcp_bhash[inet_bhashfn(inet->num, tcp_bhash_size)]; 305 bhead = &tcp_hashinfo.bhash[inet_bhashfn(inet->num, tcp_hashinfo.bhash_size)];
307 spin_lock(&bhead->lock); 306 spin_lock(&bhead->lock);
308 tw->tw_tb = inet->bind_hash; 307 tw->tw_tb = inet->bind_hash;
309 BUG_TRAP(inet->bind_hash); 308 BUG_TRAP(inet->bind_hash);
@@ -317,7 +316,7 @@ static void __tcp_tw_hashdance(struct sock *sk, struct tcp_tw_bucket *tw)
317 sock_prot_dec_use(sk->sk_prot); 316 sock_prot_dec_use(sk->sk_prot);
318 317
319 /* Step 3: Hash TW into TIMEWAIT half of established hash table. */ 318 /* Step 3: Hash TW into TIMEWAIT half of established hash table. */
320 tw_add_node(tw, &(ehead + tcp_ehash_size)->chain); 319 tw_add_node(tw, &(ehead + tcp_hashinfo.ehash_size)->chain);
321 atomic_inc(&tw->tw_refcnt); 320 atomic_inc(&tw->tw_refcnt);
322 321
323 write_unlock(&ehead->lock); 322 write_unlock(&ehead->lock);