Lines Matching refs:tb
66 struct inet_bind_bucket *tb = kmem_cache_alloc(cachep, GFP_ATOMIC); in inet_bind_bucket_create() local
68 if (tb) { in inet_bind_bucket_create()
69 write_pnet(&tb->ib_net, net); in inet_bind_bucket_create()
70 tb->port = snum; in inet_bind_bucket_create()
71 tb->fastreuse = 0; in inet_bind_bucket_create()
72 tb->fastreuseport = 0; in inet_bind_bucket_create()
73 tb->num_owners = 0; in inet_bind_bucket_create()
74 INIT_HLIST_HEAD(&tb->owners); in inet_bind_bucket_create()
75 hlist_add_head(&tb->node, &head->chain); in inet_bind_bucket_create()
77 return tb; in inet_bind_bucket_create()
83 void inet_bind_bucket_destroy(struct kmem_cache *cachep, struct inet_bind_bucket *tb) in inet_bind_bucket_destroy() argument
85 if (hlist_empty(&tb->owners)) { in inet_bind_bucket_destroy()
86 __hlist_del(&tb->node); in inet_bind_bucket_destroy()
87 kmem_cache_free(cachep, tb); in inet_bind_bucket_destroy()
91 void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, in inet_bind_hash() argument
95 sk_add_bind_node(sk, &tb->owners); in inet_bind_hash()
96 tb->num_owners++; in inet_bind_hash()
97 inet_csk(sk)->icsk_bind_hash = tb; in inet_bind_hash()
109 struct inet_bind_bucket *tb; in __inet_put_port() local
112 tb = inet_csk(sk)->icsk_bind_hash; in __inet_put_port()
114 tb->num_owners--; in __inet_put_port()
117 inet_bind_bucket_destroy(hashinfo->bind_bucket_cachep, tb); in __inet_put_port()
136 struct inet_bind_bucket *tb; in __inet_inherit_port() local
139 tb = inet_csk(sk)->icsk_bind_hash; in __inet_inherit_port()
140 if (unlikely(!tb)) { in __inet_inherit_port()
144 if (tb->port != port) { in __inet_inherit_port()
150 inet_bind_bucket_for_each(tb, &head->chain) { in __inet_inherit_port()
151 if (net_eq(ib_net(tb), sock_net(sk)) && in __inet_inherit_port()
152 tb->port == port) in __inet_inherit_port()
155 if (!tb) { in __inet_inherit_port()
156 tb = inet_bind_bucket_create(table->bind_bucket_cachep, in __inet_inherit_port()
158 if (!tb) { in __inet_inherit_port()
164 inet_bind_hash(child, tb, port); in __inet_inherit_port()
511 struct inet_bind_bucket *tb; in __inet_hash_connect() local
543 inet_bind_bucket_for_each(tb, &head->chain) { in __inet_hash_connect()
544 if (net_eq(ib_net(tb), net) && in __inet_hash_connect()
545 tb->port == port) { in __inet_hash_connect()
546 if (tb->fastreuse >= 0 || in __inet_hash_connect()
547 tb->fastreuseport >= 0) in __inet_hash_connect()
549 WARN_ON(hlist_empty(&tb->owners)); in __inet_hash_connect()
557 tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, in __inet_hash_connect()
559 if (!tb) { in __inet_hash_connect()
563 tb->fastreuse = -1; in __inet_hash_connect()
564 tb->fastreuseport = -1; in __inet_hash_connect()
578 inet_bind_hash(sk, tb, port); in __inet_hash_connect()
595 tb = inet_csk(sk)->icsk_bind_hash; in __inet_hash_connect()
597 if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { in __inet_hash_connect()