diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2009-01-27 20:45:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-27 20:45:10 -0500 |
commit | 94cd3e6cbebf85903b4d53ed2147bdb4c6e08625 (patch) | |
tree | a389198ade72eae6aa9c1cd3a44cdcc6935f6996 /include | |
parent | 15b2bee22a0390d951301b53e83df88d0350c499 (diff) |
net: wrong test in inet_ehash_locks_alloc()
In commit 9db66bdcc83749affe61c61eb8ff3cf08f42afec (net: convert
TCP/DCCP ehash rwlocks to spinlocks), I forgot to change one
occurrence of rwlock_t to spinlock_t
I believe sizeof(raw_spinlock_t) might be > 0 on !CONFIG_SMP if
CONFIG_DEBUG_SPINLOCK while sizeof(raw_rwlock_t) should be 0 in this
case.
Fortunatly, CONFIG_DEBUG_SPINLOCK adds fields to both spinlock_t and
rwlock_t, but at this might change in the future (being able to debug
spinlocks but not rwlocks for example), better to be safe.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/inet_hashtables.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index f44bb5c77a70..d0a043153cc6 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -182,7 +182,7 @@ static inline int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo) | |||
182 | size = 2048; | 182 | size = 2048; |
183 | if (nr_pcpus >= 32) | 183 | if (nr_pcpus >= 32) |
184 | size = 4096; | 184 | size = 4096; |
185 | if (sizeof(rwlock_t) != 0) { | 185 | if (sizeof(spinlock_t) != 0) { |
186 | #ifdef CONFIG_NUMA | 186 | #ifdef CONFIG_NUMA |
187 | if (size * sizeof(spinlock_t) > PAGE_SIZE) | 187 | if (size * sizeof(spinlock_t) > PAGE_SIZE) |
188 | hashinfo->ehash_locks = vmalloc(size * sizeof(spinlock_t)); | 188 | hashinfo->ehash_locks = vmalloc(size * sizeof(spinlock_t)); |