aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inetpeer.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/inetpeer.c')
-rw-r--r--net/ipv4/inetpeer.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 2160874ce7aa..2b1a54b59c48 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -86,7 +86,7 @@ static struct inet_peer *peer_root = peer_avl_empty;
86static DEFINE_RWLOCK(peer_pool_lock); 86static DEFINE_RWLOCK(peer_pool_lock);
87#define PEER_MAXDEPTH 40 /* sufficient for about 2^27 nodes */ 87#define PEER_MAXDEPTH 40 /* sufficient for about 2^27 nodes */
88 88
89static volatile int peer_total; 89static int peer_total;
90/* Exported for sysctl_net_ipv4. */ 90/* Exported for sysctl_net_ipv4. */
91int inet_peer_threshold = 65536 + 128; /* start to throw entries more 91int inet_peer_threshold = 65536 + 128; /* start to throw entries more
92 * aggressively at this stage */ 92 * aggressively at this stage */
@@ -126,12 +126,9 @@ void __init inet_initpeers(void)
126 126
127 peer_cachep = kmem_cache_create("inet_peer_cache", 127 peer_cachep = kmem_cache_create("inet_peer_cache",
128 sizeof(struct inet_peer), 128 sizeof(struct inet_peer),
129 0, SLAB_HWCACHE_ALIGN, 129 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC,
130 NULL, NULL); 130 NULL, NULL);
131 131
132 if (!peer_cachep)
133 panic("cannot create inet_peer_cache");
134
135 /* All the timers, started at system startup tend 132 /* All the timers, started at system startup tend
136 to synchronize. Perturb it a bit. 133 to synchronize. Perturb it a bit.
137 */ 134 */
@@ -166,7 +163,7 @@ static void unlink_from_unused(struct inet_peer *p)
166 for (u = peer_root; u != peer_avl_empty; ) { \ 163 for (u = peer_root; u != peer_avl_empty; ) { \
167 if (daddr == u->v4daddr) \ 164 if (daddr == u->v4daddr) \
168 break; \ 165 break; \
169 if (daddr < u->v4daddr) \ 166 if ((__force __u32)daddr < (__force __u32)u->v4daddr) \
170 v = &u->avl_left; \ 167 v = &u->avl_left; \
171 else \ 168 else \
172 v = &u->avl_right; \ 169 v = &u->avl_right; \
@@ -371,7 +368,7 @@ static int cleanup_once(unsigned long ttl)
371} 368}
372 369
373/* Called with or without local BH being disabled. */ 370/* Called with or without local BH being disabled. */
374struct inet_peer *inet_getpeer(__u32 daddr, int create) 371struct inet_peer *inet_getpeer(__be32 daddr, int create)
375{ 372{
376 struct inet_peer *p, *n; 373 struct inet_peer *p, *n;
377 struct inet_peer **stack[PEER_MAXDEPTH], ***stackptr; 374 struct inet_peer **stack[PEER_MAXDEPTH], ***stackptr;