summaryrefslogtreecommitdiffstats
path: root/net/ipv6/protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/protocol.c')
-rw-r--r--net/ipv6/protocol.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/net/ipv6/protocol.c b/net/ipv6/protocol.c
index c30e751ed..accc87cbe 100644
--- a/net/ipv6/protocol.c
+++ b/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 @@ struct inet6_protocol *inet6_protos[MAX_INET_PROTOS] =
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 @@ void inet6_add_protocol(struct inet6_protocol *prot)
}
p2 = (struct inet6_protocol *) p2->next;
}
- write_unlock_bh(&inet6_protocol_lock);
+ br_write_unlock_bh(BR_NETPROTO_LOCK);
}
/*
@@ -76,10 +75,10 @@ int inet6_del_protocol(struct inet6_protocol *prot)
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 @@ int inet6_del_protocol(struct inet6_protocol *prot)
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 @@ int inet6_del_protocol(struct inet6_protocol *prot)
p = (struct inet6_protocol *) p->next;
}
- write_unlock_bh(&inet6_protocol_lock);
+ br_write_unlock_bh(BR_NETPROTO_LOCK);
return(-1);
}