[INET]: Just rename the TCP hashtable functions/structs to inet_
This is to break down the complexity of the series of patches, making it very clear that this one just does: 1. renames tcp_ prefixed hashtable functions and data structures that were already mostly generic to inet_ to share it with DCCP and other INET transport protocols. 2. Removes not used functions (__tb_head & tb_head) 3. Removes some leftover prototypes in the headers (tcp_bucket_unlock & tcp_v4_build_header) Next changesets will move tcp_sk(sk)->bind_hash to inet_sock so that we can make functions such as tcp_inherit_port, __tcp_inherit_port, tcp_v4_get_port, __tcp_put_port, generic and get others like tcp_destroy_sock closer to generic (tcp_orphan_count will go to sk->sk_prot to allow this). Eventually most of these functions will be used passing the transport protocol inet_hashinfo structure. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
304a16180f
commit
0f7ff9274e
@@ -60,9 +60,9 @@ int tcp_tw_count;
|
||||
/* Must be called with locally disabled BHs. */
|
||||
static void tcp_timewait_kill(struct tcp_tw_bucket *tw)
|
||||
{
|
||||
struct tcp_ehash_bucket *ehead;
|
||||
struct tcp_bind_hashbucket *bhead;
|
||||
struct tcp_bind_bucket *tb;
|
||||
struct inet_ehash_bucket *ehead;
|
||||
struct inet_bind_hashbucket *bhead;
|
||||
struct inet_bind_bucket *tb;
|
||||
|
||||
/* Unlink from established hashes. */
|
||||
ehead = &tcp_ehash[tw->tw_hashent];
|
||||
@@ -76,12 +76,12 @@ static void tcp_timewait_kill(struct tcp_tw_bucket *tw)
|
||||
write_unlock(&ehead->lock);
|
||||
|
||||
/* Disassociate with bind bucket. */
|
||||
bhead = &tcp_bhash[tcp_bhashfn(tw->tw_num)];
|
||||
bhead = &tcp_bhash[inet_bhashfn(tw->tw_num, tcp_bhash_size)];
|
||||
spin_lock(&bhead->lock);
|
||||
tb = tw->tw_tb;
|
||||
__hlist_del(&tw->tw_bind_node);
|
||||
tw->tw_tb = NULL;
|
||||
tcp_bucket_destroy(tb);
|
||||
inet_bind_bucket_destroy(tcp_bucket_cachep, tb);
|
||||
spin_unlock(&bhead->lock);
|
||||
|
||||
#ifdef SOCK_REFCNT_DEBUG
|
||||
@@ -296,14 +296,14 @@ kill:
|
||||
*/
|
||||
static void __tcp_tw_hashdance(struct sock *sk, struct tcp_tw_bucket *tw)
|
||||
{
|
||||
struct tcp_ehash_bucket *ehead = &tcp_ehash[sk->sk_hashent];
|
||||
struct tcp_bind_hashbucket *bhead;
|
||||
struct inet_ehash_bucket *ehead = &tcp_ehash[sk->sk_hashent];
|
||||
struct inet_bind_hashbucket *bhead;
|
||||
|
||||
/* Step 1: Put TW into bind hash. Original socket stays there too.
|
||||
Note, that any socket with inet_sk(sk)->num != 0 MUST be bound in
|
||||
binding cache, even if it is closed.
|
||||
*/
|
||||
bhead = &tcp_bhash[tcp_bhashfn(inet_sk(sk)->num)];
|
||||
bhead = &tcp_bhash[inet_bhashfn(inet_sk(sk)->num, tcp_bhash_size)];
|
||||
spin_lock(&bhead->lock);
|
||||
tw->tw_tb = tcp_sk(sk)->bind_hash;
|
||||
BUG_TRAP(tcp_sk(sk)->bind_hash);
|
||||
|
Reference in New Issue
Block a user