patch-2.1.34 linux/net/core/dst.c

Next file: linux/net/core/skbuff.c
Previous file: linux/net/core/dev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.33/linux/net/core/dst.c linux/net/core/dst.c
@@ -20,7 +20,7 @@
 #include <net/dst.h>
 
 struct dst_entry * dst_garbage_list;
-atomic_t	dst_total;
+atomic_t	dst_total = ATOMIC_INIT;
 
 static unsigned long dst_gc_timer_expires;
 static unsigned long dst_gc_timer_inc = DST_GC_MAX;
@@ -41,7 +41,7 @@
 	del_timer(&dst_gc_timer);
 	dstp = &dst_garbage_list;
 	while ((dst = *dstp) != NULL) {
-		if (dst->use) {
+		if (atomic_read(&dst->use)) {
 			dstp = &dst->next;
 			delayed++;
 			continue;
@@ -58,7 +58,9 @@
 	dst_gc_timer_inc += DST_GC_INC;
 	dst_gc_timer.expires = jiffies + dst_gc_timer_expires;
 #if RT_CACHE_DEBUG >= 2
-	printk("dst_total: %d/%d/%d %ld\n", dst_total, delayed, hh_count, dst_gc_timer_expires);
+	printk("dst_total: %d/%d/%d %ld\n",
+	       atomic_read(&dst_total), delayed,
+	       atomic_read(&hh_count), dst_gc_timer_expires);
 #endif
 	add_timer(&dst_gc_timer);
 }
@@ -83,7 +85,7 @@
 		return NULL;
 	memset(dst, 0, size);
 	dst->ops = ops;
-	dst->refcnt = 1;
+	atomic_set(&dst->refcnt, 1);
 	dst->lastuse = jiffies;
 	dst->input = dst_discard;
 	dst->output = dst_blackhole;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov