Skip to content

Commit

Permalink
batman,rcu: convert call_rcu(neigh_node_free_rcu) to kfree()
Browse files Browse the repository at this point in the history
The RCU callback neigh_node_free_rcu() just calls kfree(), so we can use
kfree_rcu() instead of call_rcu().

Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Marek Lindner <[email protected]>
Cc: Simon Wunderlich <[email protected]>
Acked-by: David S. Miller <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Acked-by: Sven Eckelmann <[email protected]>
  • Loading branch information
paulmck committed May 8, 2011
1 parent eb340b2 commit ae179ae
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions net/batman-adv/originator.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,10 @@ int originator_init(struct bat_priv *bat_priv)
return 0;
}

static void neigh_node_free_rcu(struct rcu_head *rcu)
{
struct neigh_node *neigh_node;

neigh_node = container_of(rcu, struct neigh_node, rcu);
kfree(neigh_node);
}

void neigh_node_free_ref(struct neigh_node *neigh_node)
{
if (atomic_dec_and_test(&neigh_node->refcount))
call_rcu(&neigh_node->rcu, neigh_node_free_rcu);
kfree_rcu(neigh_node, rcu);
}

struct neigh_node *create_neighbor(struct orig_node *orig_node,
Expand Down

0 comments on commit ae179ae

Please sign in to comment.