Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79504
b: refs/heads/master
c: bc3c8c1
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jan 28, 2008
1 parent ca9f647 commit 5191771
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: a1f6f5a7689098f01d9b7b7181795ee78563ce37
refs/heads/master: bc3c8c1e02ae89668239742fd592f21e1998fa46
13 changes: 10 additions & 3 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ static struct tnode *halve(struct trie *t, struct tnode *tn);
static void tnode_free(struct tnode *tn);

static struct kmem_cache *fn_alias_kmem __read_mostly;
static struct kmem_cache *trie_leaf_kmem __read_mostly;

static inline struct tnode *node_parent(struct node *node)
{
Expand Down Expand Up @@ -325,7 +326,8 @@ static inline void alias_free_mem_rcu(struct fib_alias *fa)

static void __leaf_free_rcu(struct rcu_head *head)
{
kfree(container_of(head, struct leaf, rcu));
struct leaf *l = container_of(head, struct leaf, rcu);
kmem_cache_free(trie_leaf_kmem, l);
}

static void __leaf_info_free_rcu(struct rcu_head *head)
Expand Down Expand Up @@ -375,7 +377,7 @@ static inline void tnode_free(struct tnode *tn)

static struct leaf *leaf_new(void)
{
struct leaf *l = kmalloc(sizeof(struct leaf), GFP_KERNEL);
struct leaf *l = kmem_cache_alloc(trie_leaf_kmem, GFP_KERNEL);
if (l) {
l->parent = T_LEAF;
INIT_HLIST_HEAD(&l->list);
Expand Down Expand Up @@ -1938,7 +1940,12 @@ static int fn_trie_dump(struct fib_table *tb, struct sk_buff *skb, struct netlin
void __init fib_hash_init(void)
{
fn_alias_kmem = kmem_cache_create("ip_fib_alias", sizeof(struct fib_alias),
0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
0, SLAB_PANIC, NULL);

trie_leaf_kmem = kmem_cache_create("ip_fib_trie",
max(sizeof(struct leaf),
sizeof(struct leaf_info)),
0, SLAB_PANIC, NULL);
}


Expand Down

0 comments on commit 5191771

Please sign in to comment.