inet: add struct net argument to inet_bhashfn

Binding to some port in many namespaces may create too long
chains in bhash-es, so prepare the hashfn to take struct net
into account.

Signed-off-by: Pavel Emelyanov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Pavel Emelyanov 2008-06-16 17:12:49 -07:00 • committed by David S. Miller
commit 7f635ab71e
4 changed files with 17 additions and 9 deletions

View file

@ -201,7 +201,8 @@ extern struct inet_bind_bucket *
extern void inet_bind_bucket_destroy(struct kmem_cache *cachep,
struct inet_bind_bucket *tb);
static inline int inet_bhashfn(const __u16 lport, const int bhash_size)
static inline int inet_bhashfn(struct net *net,
const __u16 lport, const int bhash_size)
{
return lport & (bhash_size - 1);
}