Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90616
b: refs/heads/master
c: 387a548
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Apr 10, 2008
1 parent 904c314 commit 19ee559
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: ef3660ce0649fa10265455f539b72607cff53d02
refs/heads/master: 387a5487f5a1f8bfc3b2c5818e50dfd19eeb4f3f
19 changes: 11 additions & 8 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n,
static struct node *resize(struct trie *t, struct tnode *tn);
static struct tnode *inflate(struct trie *t, struct tnode *tn);
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;
Expand Down Expand Up @@ -337,6 +336,11 @@ static void __leaf_free_rcu(struct rcu_head *head)
kmem_cache_free(trie_leaf_kmem, l);
}

static inline void free_leaf(struct leaf *l)
{
call_rcu_bh(&l->rcu, __leaf_free_rcu);
}

static void __leaf_info_free_rcu(struct rcu_head *head)
{
kfree(container_of(head, struct leaf_info, rcu));
Expand Down Expand Up @@ -377,10 +381,9 @@ static void __tnode_free_rcu(struct rcu_head *head)

static inline void tnode_free(struct tnode *tn)
{
if (IS_LEAF(tn)) {
struct leaf *l = (struct leaf *) tn;
call_rcu_bh(&l->rcu, __leaf_free_rcu);
} else
if (IS_LEAF(tn))
free_leaf((struct leaf *) tn);
else
call_rcu(&tn->rcu, __tnode_free_rcu);
}

Expand Down Expand Up @@ -1091,7 +1094,7 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen)
li = leaf_info_new(plen);

if (!li) {
tnode_free((struct tnode *) l);
free_leaf(l);
return NULL;
}

Expand Down Expand Up @@ -1127,7 +1130,7 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen)

if (!tn) {
free_leaf_info(li);
tnode_free((struct tnode *) l);
free_leaf(l);
return NULL;
}

Expand Down Expand Up @@ -1583,7 +1586,7 @@ static void trie_leaf_remove(struct trie *t, struct leaf *l)
} else
rcu_assign_pointer(t->trie, NULL);

tnode_free((struct tnode *) l);
free_leaf(l);
}

/*
Expand Down

0 comments on commit 19ee559

Please sign in to comment.