Lines Matching refs:tb
65 struct inet_bind_bucket *tb = kmem_cache_alloc(cachep, GFP_ATOMIC); in inet_bind_bucket_create() local
67 if (tb) { in inet_bind_bucket_create()
68 write_pnet(&tb->ib_net, net); in inet_bind_bucket_create()
69 tb->port = snum; in inet_bind_bucket_create()
70 tb->fastreuse = 0; in inet_bind_bucket_create()
71 tb->fastreuseport = 0; in inet_bind_bucket_create()
72 tb->num_owners = 0; in inet_bind_bucket_create()
73 INIT_HLIST_HEAD(&tb->owners); in inet_bind_bucket_create()
74 hlist_add_head(&tb->node, &head->chain); in inet_bind_bucket_create()
76 return tb; in inet_bind_bucket_create()
82 void inet_bind_bucket_destroy(struct kmem_cache *cachep, struct inet_bind_bucket *tb) in inet_bind_bucket_destroy() argument
84 if (hlist_empty(&tb->owners)) { in inet_bind_bucket_destroy()
85 __hlist_del(&tb->node); in inet_bind_bucket_destroy()
86 kmem_cache_free(cachep, tb); in inet_bind_bucket_destroy()
90 void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, in inet_bind_hash() argument
98 sk_add_bind_node(sk, &tb->owners); in inet_bind_hash()
99 tb->num_owners++; in inet_bind_hash()
100 inet_csk(sk)->icsk_bind_hash = tb; in inet_bind_hash()
112 struct inet_bind_bucket *tb; in __inet_put_port() local
117 tb = inet_csk(sk)->icsk_bind_hash; in __inet_put_port()
119 tb->num_owners--; in __inet_put_port()
122 inet_bind_bucket_destroy(hashinfo->bind_bucket_cachep, tb); in __inet_put_port()
141 struct inet_bind_bucket *tb; in __inet_inherit_port() local
144 tb = inet_csk(sk)->icsk_bind_hash; in __inet_inherit_port()
145 if (tb->port != port) { in __inet_inherit_port()
151 inet_bind_bucket_for_each(tb, &head->chain) { in __inet_inherit_port()
152 if (net_eq(ib_net(tb), sock_net(sk)) && in __inet_inherit_port()
153 tb->port == port) in __inet_inherit_port()
156 if (!tb) { in __inet_inherit_port()
157 tb = inet_bind_bucket_create(table->bind_bucket_cachep, in __inet_inherit_port()
159 if (!tb) { in __inet_inherit_port()
165 inet_bind_hash(child, tb, port); in __inet_inherit_port()
496 struct inet_bind_bucket *tb; in __inet_hash_connect() local
523 inet_bind_bucket_for_each(tb, &head->chain) { in __inet_hash_connect()
524 if (net_eq(ib_net(tb), net) && in __inet_hash_connect()
525 tb->port == port) { in __inet_hash_connect()
526 if (tb->fastreuse >= 0 || in __inet_hash_connect()
527 tb->fastreuseport >= 0) in __inet_hash_connect()
529 WARN_ON(hlist_empty(&tb->owners)); in __inet_hash_connect()
537 tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, in __inet_hash_connect()
539 if (!tb) { in __inet_hash_connect()
543 tb->fastreuse = -1; in __inet_hash_connect()
544 tb->fastreuseport = -1; in __inet_hash_connect()
558 inet_bind_hash(sk, tb, port); in __inet_hash_connect()
580 tb = inet_csk(sk)->icsk_bind_hash; in __inet_hash_connect()
582 if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { in __inet_hash_connect()