This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / net / core / neighbour.c
index 47966b5..c722fa0 100644 (file)
@@ -59,6 +59,7 @@ static void neigh_app_notify(struct neighbour *n);
 static int pneigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
 void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
 
+static int neigh_glbl_allocs;
 static struct neigh_table *neigh_tables;
 static struct file_operations neigh_stat_seq_fops;
 
@@ -271,7 +272,7 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl)
        memset(n, 0, tbl->entry_size);
 
        skb_queue_head_init(&n->arp_queue);
-       rwlock_init(&n->lock);
+       n->lock           = RW_LOCK_UNLOCKED;
        n->updated        = n->used = now;
        n->nud_state      = NUD_NONE;
        n->output         = neigh_blackhole;
@@ -281,6 +282,7 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl)
        n->timer.data     = (unsigned long)n;
 
        NEIGH_CACHE_STAT_INC(tbl, allocs);
+       neigh_glbl_allocs++;
        n->tbl            = tbl;
        atomic_set(&n->refcnt, 1);
        n->dead           = 1;
@@ -610,6 +612,7 @@ void neigh_destroy(struct neighbour *neigh)
 
        NEIGH_PRINTK2("neigh %p is destroyed.\n", neigh);
 
+       neigh_glbl_allocs--;
        atomic_dec(&neigh->tbl->entries);
        kmem_cache_free(neigh->tbl->kmem_cachep, neigh);
 }
@@ -1091,7 +1094,7 @@ static void neigh_hh_init(struct neighbour *n, struct dst_entry *dst,
 
        if (!hh && (hh = kmalloc(sizeof(*hh), GFP_ATOMIC)) != NULL) {
                memset(hh, 0, sizeof(struct hh_cache));
-               rwlock_init(&hh->hh_lock);
+               hh->hh_lock = RW_LOCK_UNLOCKED;
                hh->hh_type = protocol;
                atomic_set(&hh->hh_refcnt, 0);
                hh->hh_next = NULL;
@@ -1367,7 +1370,7 @@ void neigh_table_init(struct neigh_table *tbl)
 
        get_random_bytes(&tbl->hash_rnd, sizeof(tbl->hash_rnd));
 
-       rwlock_init(&tbl->lock);
+       tbl->lock              = RW_LOCK_UNLOCKED;
        init_timer(&tbl->gc_timer);
        tbl->gc_timer.data     = (unsigned long)tbl;
        tbl->gc_timer.function = neigh_periodic_timer;