Skip to content

Commit

Permalink
audit_tree,rcu: Convert call_rcu(__put_tree) to kfree_rcu()
Browse files Browse the repository at this point in the history
The rcu callback __put_tree() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(__put_tree).

Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Eric Paris <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
  • Loading branch information
Lai Jiangshan authored and paulmck committed Jul 20, 2011
1 parent 6034f7e commit 3b097c4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions kernel/audit_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,10 @@ static inline void get_tree(struct audit_tree *tree)
atomic_inc(&tree->count);
}

static void __put_tree(struct rcu_head *rcu)
{
struct audit_tree *tree = container_of(rcu, struct audit_tree, head);
kfree(tree);
}

static inline void put_tree(struct audit_tree *tree)
{
if (atomic_dec_and_test(&tree->count))
call_rcu(&tree->head, __put_tree);
kfree_rcu(tree, head);
}

/* to avoid bringing the entire thing in audit.h */
Expand Down

0 comments on commit 3b097c4

Please sign in to comment.