提交 a6ad57ef 编写于 作者: W Wei Yongjun 提交者: Nicholas Bellinger

tcm_fc: using kfree_rcu() to simplify the code

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: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 5d358065
...@@ -428,19 +428,12 @@ static int ft_prli(struct fc_rport_priv *rdata, u32 spp_len, ...@@ -428,19 +428,12 @@ static int ft_prli(struct fc_rport_priv *rdata, u32 spp_len,
return ret; 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) static void ft_sess_free(struct kref *kref)
{ {
struct ft_sess *sess = container_of(kref, struct ft_sess, kref); struct ft_sess *sess = container_of(kref, struct ft_sess, kref);
transport_deregister_session(sess->se_sess); 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) void ft_sess_put(struct ft_sess *sess)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册