vserver 1.9.5.x5
[linux-2.6.git] / net / ipv6 / sit.c
index 3ddbd6c..b517fa5 100644 (file)
@@ -73,7 +73,7 @@ static struct ip_tunnel *tunnels_l[HASH_SIZE];
 static struct ip_tunnel *tunnels_wc[1];
 static struct ip_tunnel **tunnels[4] = { tunnels_wc, tunnels_l, tunnels_r, tunnels_r_l };
 
-static rwlock_t ipip6_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(ipip6_lock);
 
 static struct ip_tunnel * ipip6_tunnel_lookup(u32 remote, u32 local)
 {
@@ -135,10 +135,10 @@ static void ipip6_tunnel_link(struct ip_tunnel *t)
 {
        struct ip_tunnel **tp = ipip6_bucket(t);
 
-       write_lock_bh(&ipip6_lock);
        t->next = *tp;
-       write_unlock_bh(&ipip6_lock);
+       write_lock_bh(&ipip6_lock);
        *tp = t;
+       write_unlock_bh(&ipip6_lock);
 }
 
 static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create)