diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-08 20:16:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-13 06:44:02 -0400 |
commit | f373b53b5fe67aa4a6f28f921a529cc90f88e79b (patch) | |
tree | b2cae9152aed2e30b7a39c114678b9355ab5c14f /include/net/inet_hashtables.h | |
parent | c3faca053d0a9c877597935b434150b422dbc6fb (diff) |
tcp: replace ehash_size by ehash_mask
Storing the mask (size - 1) instead of the size allows fast path to be
a bit faster.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_hashtables.h')
-rw-r--r-- | include/net/inet_hashtables.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index d522dcf3031a..5f11c4a0daca 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -125,7 +125,7 @@ struct inet_hashinfo { | |||
125 | */ | 125 | */ |
126 | struct inet_ehash_bucket *ehash; | 126 | struct inet_ehash_bucket *ehash; |
127 | spinlock_t *ehash_locks; | 127 | spinlock_t *ehash_locks; |
128 | unsigned int ehash_size; | 128 | unsigned int ehash_mask; |
129 | unsigned int ehash_locks_mask; | 129 | unsigned int ehash_locks_mask; |
130 | 130 | ||
131 | /* Ok, let's try this, I give up, we do need a local binding | 131 | /* Ok, let's try this, I give up, we do need a local binding |
@@ -158,7 +158,7 @@ static inline struct inet_ehash_bucket *inet_ehash_bucket( | |||
158 | struct inet_hashinfo *hashinfo, | 158 | struct inet_hashinfo *hashinfo, |
159 | unsigned int hash) | 159 | unsigned int hash) |
160 | { | 160 | { |
161 | return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; | 161 | return &hashinfo->ehash[hash & hashinfo->ehash_mask]; |
162 | } | 162 | } |
163 | 163 | ||
164 | static inline spinlock_t *inet_ehash_lockp( | 164 | static inline spinlock_t *inet_ehash_lockp( |