patch-2.3.49 linux/net/ipv6/protocol.c
Next file: linux/net/ipv6/raw.c
Previous file: linux/net/ipv6/ipv6_sockglue.c
Back to the patch index
Back to the overall index
- Lines: 73
- Date:
Sat Feb 26 22:34:27 2000
- Orig file:
v2.3.48/linux/net/ipv6/protocol.c
- Orig date:
Thu Aug 26 13:05:46 1999
diff -u --recursive --new-file v2.3.48/linux/net/ipv6/protocol.c linux/net/ipv6/protocol.c
@@ -5,7 +5,7 @@
*
* PF_INET6 protocol dispatch tables.
*
- * Version: $Id: protocol.c,v 1.7 1999/08/20 11:06:26 davem Exp $
+ * Version: $Id: protocol.c,v 1.8 2000/02/22 23:54:29 davem Exp $
*
* Authors: Pedro Roque <roque@di.fc.ul.pt>
*
@@ -24,6 +24,7 @@
#include <linux/in6.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
+#include <linux/brlock.h>
#include <net/sock.h>
#include <net/snmp.h>
@@ -37,15 +38,13 @@
NULL
};
-rwlock_t inet6_protocol_lock = RW_LOCK_UNLOCKED;
-
void inet6_add_protocol(struct inet6_protocol *prot)
{
unsigned char hash;
struct inet6_protocol *p2;
hash = prot->protocol & (MAX_INET_PROTOS - 1);
- write_lock_bh(&inet6_protocol_lock);
+ br_write_lock_bh(BR_NETPROTO_LOCK);
prot->next = inet6_protos[hash];
inet6_protos[hash] = prot;
prot->copy = 0;
@@ -62,7 +61,7 @@
}
p2 = (struct inet6_protocol *) p2->next;
}
- write_unlock_bh(&inet6_protocol_lock);
+ br_write_unlock_bh(BR_NETPROTO_LOCK);
}
/*
@@ -76,10 +75,10 @@
unsigned char hash;
hash = prot->protocol & (MAX_INET_PROTOS - 1);
- write_lock_bh(&inet6_protocol_lock);
+ br_write_lock_bh(BR_NETPROTO_LOCK);
if (prot == inet6_protos[hash]) {
inet6_protos[hash] = (struct inet6_protocol *) inet6_protos[hash]->next;
- write_unlock_bh(&inet6_protocol_lock);
+ br_write_unlock_bh(BR_NETPROTO_LOCK);
return(0);
}
@@ -98,7 +97,7 @@
if (p->copy == 0 && lp != NULL)
lp->copy = 0;
p->next = prot->next;
- write_unlock_bh(&inet6_protocol_lock);
+ br_write_unlock_bh(BR_NETPROTO_LOCK);
return(0);
}
if (p->next != NULL && p->next->protocol == prot->protocol)
@@ -106,6 +105,6 @@
p = (struct inet6_protocol *) p->next;
}
- write_unlock_bh(&inet6_protocol_lock);
+ br_write_unlock_bh(BR_NETPROTO_LOCK);
return(-1);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)