diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-06-16 20:13:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-16 20:13:27 -0400 |
commit | 9f26b3add3783c0af869ea2207871da5dafefffa (patch) | |
tree | adadfc84d2daf5133c0c536d87242df049daf53e /net/ipv4/inet_hashtables.c | |
parent | 2086a65078bd24682bdcf413d9c91d81988b8359 (diff) |
inet: add struct net argument to inet_ehashfn
Although this hash takes addresses into account, the ehash chains
can also be too long when, for instance, communications via lo occur.
So, prepare the inet_hashfn to take struct net into account.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_hashtables.c')
-rw-r--r-- | net/ipv4/inet_hashtables.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 4f597b3175e7..eca5899729e3 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c | |||
@@ -227,7 +227,7 @@ struct sock * __inet_lookup_established(struct net *net, | |||
227 | /* Optimize here for direct hit, only listening connections can | 227 | /* Optimize here for direct hit, only listening connections can |
228 | * have wildcards anyways. | 228 | * have wildcards anyways. |
229 | */ | 229 | */ |
230 | unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport); | 230 | unsigned int hash = inet_ehashfn(net, daddr, hnum, saddr, sport); |
231 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); | 231 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); |
232 | rwlock_t *lock = inet_ehash_lockp(hashinfo, hash); | 232 | rwlock_t *lock = inet_ehash_lockp(hashinfo, hash); |
233 | 233 | ||
@@ -267,13 +267,13 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row, | |||
267 | int dif = sk->sk_bound_dev_if; | 267 | int dif = sk->sk_bound_dev_if; |
268 | INET_ADDR_COOKIE(acookie, saddr, daddr) | 268 | INET_ADDR_COOKIE(acookie, saddr, daddr) |
269 | const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport); | 269 | const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport); |
270 | unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport); | 270 | struct net *net = sock_net(sk); |
271 | unsigned int hash = inet_ehashfn(net, daddr, lport, saddr, inet->dport); | ||
271 | struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); | 272 | struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); |
272 | rwlock_t *lock = inet_ehash_lockp(hinfo, hash); | 273 | rwlock_t *lock = inet_ehash_lockp(hinfo, hash); |
273 | struct sock *sk2; | 274 | struct sock *sk2; |
274 | const struct hlist_node *node; | 275 | const struct hlist_node *node; |
275 | struct inet_timewait_sock *tw; | 276 | struct inet_timewait_sock *tw; |
276 | struct net *net = sock_net(sk); | ||
277 | 277 | ||
278 | prefetch(head->chain.first); | 278 | prefetch(head->chain.first); |
279 | write_lock(lock); | 279 | write_lock(lock); |