Skip to content

Commit 4dd7108

Browse files
q2vendavem330
authored andcommitted
tcp: Rename tb in inet_bind2_bucket_(init|create)().
Later, we no longer link sockets to bhash. Instead, each bhash2 bucket is linked to the corresponding bhash bucket. Then, we pass the bhash bucket to bhash2 allocation functions as tb. However, tb is already used in inet_bind2_bucket_create() and inet_bind2_bucket_init() as the bhash2 bucket. To make the following diff clear, let's use tb2 for the bhash2 bucket there. Signed-off-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5a22bba commit 4dd7108

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

net/ipv4/inet_hashtables.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,30 +100,30 @@ bool inet_bind_bucket_match(const struct inet_bind_bucket *tb, const struct net
100100
tb->l3mdev == l3mdev;
101101
}
102102

103-
static void inet_bind2_bucket_init(struct inet_bind2_bucket *tb,
103+
static void inet_bind2_bucket_init(struct inet_bind2_bucket *tb2,
104104
struct net *net,
105105
struct inet_bind_hashbucket *head,
106106
unsigned short port, int l3mdev,
107107
const struct sock *sk)
108108
{
109-
write_pnet(&tb->ib_net, net);
110-
tb->l3mdev = l3mdev;
111-
tb->port = port;
109+
write_pnet(&tb2->ib_net, net);
110+
tb2->l3mdev = l3mdev;
111+
tb2->port = port;
112112
#if IS_ENABLED(CONFIG_IPV6)
113113
BUILD_BUG_ON(USHRT_MAX < (IPV6_ADDR_ANY | IPV6_ADDR_MAPPED));
114114
if (sk->sk_family == AF_INET6) {
115-
tb->addr_type = ipv6_addr_type(&sk->sk_v6_rcv_saddr);
116-
tb->v6_rcv_saddr = sk->sk_v6_rcv_saddr;
115+
tb2->addr_type = ipv6_addr_type(&sk->sk_v6_rcv_saddr);
116+
tb2->v6_rcv_saddr = sk->sk_v6_rcv_saddr;
117117
} else {
118-
tb->addr_type = IPV6_ADDR_MAPPED;
119-
ipv6_addr_set_v4mapped(sk->sk_rcv_saddr, &tb->v6_rcv_saddr);
118+
tb2->addr_type = IPV6_ADDR_MAPPED;
119+
ipv6_addr_set_v4mapped(sk->sk_rcv_saddr, &tb2->v6_rcv_saddr);
120120
}
121121
#else
122-
tb->rcv_saddr = sk->sk_rcv_saddr;
122+
tb2->rcv_saddr = sk->sk_rcv_saddr;
123123
#endif
124-
INIT_HLIST_HEAD(&tb->owners);
125-
INIT_HLIST_HEAD(&tb->deathrow);
126-
hlist_add_head(&tb->node, &head->chain);
124+
INIT_HLIST_HEAD(&tb2->owners);
125+
INIT_HLIST_HEAD(&tb2->deathrow);
126+
hlist_add_head(&tb2->node, &head->chain);
127127
}
128128

129129
struct inet_bind2_bucket *inet_bind2_bucket_create(struct kmem_cache *cachep,
@@ -133,12 +133,12 @@ struct inet_bind2_bucket *inet_bind2_bucket_create(struct kmem_cache *cachep,
133133
int l3mdev,
134134
const struct sock *sk)
135135
{
136-
struct inet_bind2_bucket *tb = kmem_cache_alloc(cachep, GFP_ATOMIC);
136+
struct inet_bind2_bucket *tb2 = kmem_cache_alloc(cachep, GFP_ATOMIC);
137137

138-
if (tb)
139-
inet_bind2_bucket_init(tb, net, head, port, l3mdev, sk);
138+
if (tb2)
139+
inet_bind2_bucket_init(tb2, net, head, port, l3mdev, sk);
140140

141-
return tb;
141+
return tb2;
142142
}
143143

144144
/* Caller must hold hashbucket lock for this tb with local BH disabled */

0 commit comments

Comments
 (0)