===== include/net/neighbour.h 1.4 vs edited ===== --- 1.4/include/net/neighbour.h 2004-10-06 04:22:37 +10:00 +++ edited/include/net/neighbour.h 2004-11-07 19:03:05 +11:00 @@ -174,7 +174,7 @@ struct timer_list gc_timer; struct timer_list proxy_timer; struct sk_buff_head proxy_queue; - int entries; + atomic_t entries; rwlock_t lock; unsigned long last_rand; struct neigh_parms *parms_list; ===== net/core/neighbour.c 1.14 vs edited ===== --- 1.14/net/core/neighbour.c 2004-10-06 04:40:25 +10:00 +++ edited/net/core/neighbour.c 2004-11-07 19:04:24 +11:00 @@ -257,11 +257,11 @@ struct neighbour *n; unsigned long now = jiffies; - if (tbl->entries > tbl->gc_thresh3 || - (tbl->entries > tbl->gc_thresh2 && + if (atomic_read(&tbl->entries) > tbl->gc_thresh3 || + (atomic_read(&tbl->entries) > tbl->gc_thresh2 && now - tbl->last_flush > 5*HZ)) { if (neigh_forced_gc(tbl) == 0 && - tbl->entries > tbl->gc_thresh3) + atomic_read(&tbl->entries) > tbl->gc_thresh3) return NULL; } @@ -282,7 +282,7 @@ n->timer.data = (unsigned long)n; NEIGH_CACHE_STAT_INC(tbl, allocs); neigh_glbl_allocs++; - tbl->entries++; + atomic_inc(&tbl->entries); n->tbl = tbl; atomic_set(&n->refcnt, 1); n->dead = 1; @@ -428,7 +428,7 @@ hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; write_lock_bh(&tbl->lock); - if (tbl->entries > (tbl->hash_mask + 1)) + if (atomic_read(&tbl->entries) > (tbl->hash_mask + 1)) neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); for (n1 = tbl->hash_buckets[hash_val]; n1; n1 = n1->next) { if (dev == n1->dev && @@ -583,7 +583,7 @@ NEIGH_PRINTK2("neigh %p is destroyed.\n", neigh); neigh_glbl_allocs--; - neigh->tbl->entries--; + atomic_dec(&neigh->tbl->entries); kmem_cache_free(neigh->tbl->kmem_cachep, neigh); } @@ -1306,7 +1306,7 @@ del_timer_sync(&tbl->proxy_timer); pneigh_queue_purge(&tbl->proxy_queue); neigh_ifdown(tbl, NULL); - if (tbl->entries) + if (atomic_read(&tbl->entries)) printk(KERN_CRIT "neighbour leakage\n"); write_lock(&neigh_tbl_lock); for (tp = &neigh_tables; *tp; tp = &(*tp)->next) { @@ -1858,7 +1858,7 @@ seq_printf(seq, "%08x %08lx %08lx %08lx %08lx %08lx %08lx " "%08lx %08lx %08lx %08lx\n", - tbl->entries, + atomic_read(&tbl->entries), st->allocs, st->destroys,