Skip to content

Commit

Permalink
tcm_fc: using kfree_rcu() to simplify the code
Browse files Browse the repository at this point in the history
The callback function of call_rcu() just calls a kfree(), so we
can use kfree_rcu() instead of call_rcu() + callback function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Wei Yongjun authored and Nicholas Bellinger committed Apr 25, 2013
1 parent 5d35806 commit a6ad57e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/target/tcm_fc/tfc_sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,12 @@ static int ft_prli(struct fc_rport_priv *rdata, u32 spp_len,
return ret;
}

static void ft_sess_rcu_free(struct rcu_head *rcu)
{
struct ft_sess *sess = container_of(rcu, struct ft_sess, rcu);

kfree(sess);
}

static void ft_sess_free(struct kref *kref)
{
struct ft_sess *sess = container_of(kref, struct ft_sess, kref);

transport_deregister_session(sess->se_sess);
call_rcu(&sess->rcu, ft_sess_rcu_free);
kfree_rcu(sess, rcu);
}

void ft_sess_put(struct ft_sess *sess)
Expand Down

0 comments on commit a6ad57e

Please sign in to comment.