Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278298
b: refs/heads/master
c: 5b8b006
h: refs/heads/master
v: v3
  • Loading branch information
David Miller committed Nov 30, 2011
1 parent 46b442a commit 3e938ed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1026fec8739663621d64216ba939c23bc1d089b7
refs/heads/master: 5b8b0060cbd6332ae5d1fa0bec0e8e211248d0e7
1 change: 0 additions & 1 deletion trunk/include/net/neighbour.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ struct neigh_table {
atomic_t entries;
rwlock_t lock;
unsigned long last_rand;
struct kmem_cache *kmem_cachep;
struct neigh_statistics __percpu *stats;
struct neigh_hash_table __rcu *nht;
struct pneigh_entry **phash_buckets;
Expand Down
18 changes: 2 additions & 16 deletions trunk/net/core/neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl)
goto out_entries;
}

n = kmem_cache_zalloc(tbl->kmem_cachep, GFP_ATOMIC);
n = kzalloc(tbl->entry_size, GFP_ATOMIC);
if (!n)
goto out_entries;

Expand Down Expand Up @@ -678,12 +678,6 @@ static inline void neigh_parms_put(struct neigh_parms *parms)
neigh_parms_destroy(parms);
}

static void neigh_destroy_rcu(struct rcu_head *head)
{
struct neighbour *neigh = container_of(head, struct neighbour, rcu);

kmem_cache_free(neigh->tbl->kmem_cachep, neigh);
}
/*
* neighbour must already be out of the table;
*
Expand Down Expand Up @@ -711,7 +705,7 @@ void neigh_destroy(struct neighbour *neigh)
NEIGH_PRINTK2("neigh %p is destroyed.\n", neigh);

atomic_dec(&neigh->tbl->entries);
call_rcu(&neigh->rcu, neigh_destroy_rcu);
kfree_rcu(neigh, rcu);
}
EXPORT_SYMBOL(neigh_destroy);

Expand Down Expand Up @@ -1486,11 +1480,6 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
tbl->parms.reachable_time =
neigh_rand_reach_time(tbl->parms.base_reachable_time);

if (!tbl->kmem_cachep)
tbl->kmem_cachep =
kmem_cache_create(tbl->id, tbl->entry_size, 0,
SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL);
tbl->stats = alloc_percpu(struct neigh_statistics);
if (!tbl->stats)
panic("cannot create neighbour cache statistics");
Expand Down Expand Up @@ -1575,9 +1564,6 @@ int neigh_table_clear(struct neigh_table *tbl)
free_percpu(tbl->stats);
tbl->stats = NULL;

kmem_cache_destroy(tbl->kmem_cachep);
tbl->kmem_cachep = NULL;

return 0;
}
EXPORT_SYMBOL(neigh_table_clear);
Expand Down

0 comments on commit 3e938ed

Please sign in to comment.