aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-03-11 09:48:28 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2013-04-25 04:05:23 -0400
commita6ad57efc39ca0ed58733f13f658ac14317a90ba (patch)
treeff4fd70aba744684a5a43a7bbf91a78e74f6573b /drivers/target
parent5d358065daaed54e8cacf911ab9f9554a845bd00 (diff)
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/tcm_fc/tfc_sess.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c
index 113f33598b9f..4859505ae2ed 100644
--- a/drivers/target/tcm_fc/tfc_sess.c
+++ b/drivers/target/tcm_fc/tfc_sess.c
@@ -428,19 +428,12 @@ static int ft_prli(struct fc_rport_priv *rdata, u32 spp_len,
428 return ret; 428 return ret;
429} 429}
430 430
431static void ft_sess_rcu_free(struct rcu_head *rcu)
432{
433 struct ft_sess *sess = container_of(rcu, struct ft_sess, rcu);
434
435 kfree(sess);
436}
437
438static void ft_sess_free(struct kref *kref) 431static void ft_sess_free(struct kref *kref)
439{ 432{
440 struct ft_sess *sess = container_of(kref, struct ft_sess, kref); 433 struct ft_sess *sess = container_of(kref, struct ft_sess, kref);
441 434
442 transport_deregister_session(sess->se_sess); 435 transport_deregister_session(sess->se_sess);
443 call_rcu(&sess->rcu, ft_sess_rcu_free); 436 kfree_rcu(sess, rcu);
444} 437}
445 438
446void ft_sess_put(struct ft_sess *sess) 439void ft_sess_put(struct ft_sess *sess)