tcm_fc: using kfree_rcu() to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 11 Mar 2013 13:48:28 +0000 (21:48 +0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 25 Apr 2013 08:05:23 +0000 (01:05 -0700)
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>
drivers/target/tcm_fc/tfc_sess.c

index 113f33598b9f0a442c631838ab712e1f2f3d6d3e..4859505ae2ed3da7d0a2aec8a15878529c6a71bb 100644 (file)
@@ -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)