patch-2.2.5 linux/net/sched/cls_u32.c
Next file: linux/net/sched/estimator.c
Previous file: linux/net/sched/cls_rsvp.h
Back to the patch index
Back to the overall index
- Lines: 70
- Date:
Thu Mar 25 09:23:34 1999
- Orig file:
v2.2.4/linux/net/sched/cls_u32.c
- Orig date:
Tue Mar 23 14:35:48 1999
diff -u --recursive --new-file v2.2.4/linux/net/sched/cls_u32.c linux/net/sched/cls_u32.c
@@ -114,7 +114,7 @@
int sel = 0;
int i;
-#if !defined(__i386__) && !defined(__m68k__)
+#if !defined(__i386__) && !defined(__mc68000__)
if ((unsigned long)ptr & 3)
return -1;
#endif
@@ -326,9 +326,8 @@
if (ht) {
for (kp = &ht->ht[TC_U32_HASH(key->handle)]; *kp; kp = &(*kp)->next) {
if (*kp == key) {
- net_serialize_enter();
*kp = key->next;
- net_serialize_leave();
+ synchronize_bh();
u32_destroy_key(tp, key);
return 0;
@@ -346,9 +345,9 @@
for (h=0; h<=ht->divisor; h++) {
while ((n = ht->ht[h]) != NULL) {
- net_serialize_enter();
ht->ht[h] = n->next;
- net_serialize_leave();
+ synchronize_bh();
+
u32_destroy_key(tp, n);
}
}
@@ -466,9 +465,8 @@
ht_down->refcnt++;
}
- net_serialize_enter();
ht_down = xchg(&n->ht_down, ht_down);
- net_serialize_leave();
+ synchronize_bh();
if (ht_down)
ht_down->refcnt--;
@@ -484,9 +482,10 @@
#ifdef CONFIG_NET_CLS_POLICE
if (tb[TCA_U32_POLICE-1]) {
struct tcf_police *police = tcf_police_locate(tb[TCA_U32_POLICE-1], est);
- net_serialize_enter();
+
police = xchg(&n->police, police);
- net_serialize_leave();
+ synchronize_bh();
+
tcf_police_release(police);
}
#endif
@@ -588,10 +587,11 @@
for (ins = &ht->ht[TC_U32_HASH(handle)]; *ins; ins = &(*ins)->next)
if (TC_U32_NODE(handle) < TC_U32_NODE((*ins)->handle))
break;
- net_serialize_enter();
+
n->next = *ins;
+ wmb();
*ins = n;
- net_serialize_leave();
+
*arg = (unsigned long)n;
return 0;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)