Lines Matching refs:tb

61 	struct inet_bind_bucket *tb = kmem_cache_alloc(cachep, GFP_ATOMIC);
63 if (tb != NULL) {
64 write_pnet(&tb->ib_net, hold_net(net));
65 tb->port = snum;
66 tb->fastreuse = 0;
67 tb->fastreuseport = 0;
68 tb->num_owners = 0;
69 INIT_HLIST_HEAD(&tb->owners);
70 hlist_add_head(&tb->node, &head->chain);
72 return tb;
76 * Caller must hold hashbucket lock for this tb with local BH disabled
78 void inet_bind_bucket_destroy(struct kmem_cache *cachep, struct inet_bind_bucket *tb)
80 if (hlist_empty(&tb->owners)) {
81 __hlist_del(&tb->node);
82 release_net(ib_net(tb));
83 kmem_cache_free(cachep, tb);
87 void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
95 sk_add_bind_node(sk, &tb->owners);
96 tb->num_owners++;
97 inet_csk(sk)->icsk_bind_hash = tb;
109 struct inet_bind_bucket *tb;
114 tb = inet_csk(sk)->icsk_bind_hash;
116 tb->num_owners--;
119 inet_bind_bucket_destroy(hashinfo->bind_bucket_cachep, tb);
138 struct inet_bind_bucket *tb;
141 tb = inet_csk(sk)->icsk_bind_hash;
142 if (tb->port != port) {
148 inet_bind_bucket_for_each(tb, &head->chain) {
149 if (net_eq(ib_net(tb), sock_net(sk)) &&
150 tb->port == port)
153 if (!tb) {
154 tb = inet_bind_bucket_create(table->bind_bucket_cachep,
156 if (!tb) {
162 inet_bind_hash(child, tb, port);
486 struct inet_bind_bucket *tb;
513 inet_bind_bucket_for_each(tb, &head->chain) {
514 if (net_eq(ib_net(tb), net) &&
515 tb->port == port) {
516 if (tb->fastreuse >= 0 ||
517 tb->fastreuseport >= 0)
519 WARN_ON(hlist_empty(&tb->owners));
527 tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep,
529 if (!tb) {
533 tb->fastreuse = -1;
534 tb->fastreuseport = -1;
548 inet_bind_hash(sk, tb, port);
570 tb = inet_csk(sk)->icsk_bind_hash;
572 if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) {