From b6e5aa684ce509f86e3931c1bf6d41561bbae5c9 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 2 Feb 2012 19:11:33 +0000 Subject: [PATCH] Source: http://marc.info/?l=linux-scsi&m=132812597504750 From: "Paul E. McKenney" The call_rcu() in ft_tport_delete() invokes ft_tport_rcu_free(), which just does a kfree(). So convert the call_rcu() to kfree_rcu(), allowing ft_tport_rcu_free() to be eliminated. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney Cc: "Nicholas A. Bellinger" Cc: Jiri Kosina Cc: Jesper Juhl Cc: linux-scsi@vger.kernel.org Cc: target-devel@vger.kernel.org --- drivers/target/tcm_fc/tfc_sess.c | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-) diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index 4c0507c..eff512b 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c @@ -86,16 +86,6 @@ static struct ft_tport *ft_tport_create(struct fc_lport *lport) } /* - * Free tport via RCU. - */ -static void ft_tport_rcu_free(struct rcu_head *rcu) -{ - struct ft_tport *tport = container_of(rcu, struct ft_tport, rcu); - - kfree(tport); -} - -/* * Delete a target local port. * Caller holds ft_lport_lock. */ @@ -114,7 +104,7 @@ static void ft_tport_delete(struct ft_tport *tport) tpg->tport = NULL; tport->tpg = NULL; } - call_rcu(&tport->rcu, ft_tport_rcu_free); + kfree_rcu(tport, rcu); } /* -- 1.7.8 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4106 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/ft_sess.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/fcst/ft_sess.c b/fcst/ft_sess.c index 49c78b4e7..b506c463a 100644 --- a/fcst/ft_sess.c +++ b/fcst/ft_sess.c @@ -78,16 +78,6 @@ static struct ft_tport *ft_tport_create(struct fc_lport *lport) return tport; } -/* - * Free tport via RCU. - */ -static void ft_tport_rcu_free(struct rcu_head *rcu) -{ - struct ft_tport *tport = container_of(rcu, struct ft_tport, rcu); - - kfree(tport); -} - /* * Delete target local port, if any, associated with the local port. * Caller holds ft_lport_lock. @@ -105,7 +95,7 @@ static void ft_tport_delete(struct ft_tport *tport) BUG_ON(tport != lport->prov[FC_TYPE_FCP]); rcu_assign_pointer(lport->prov[FC_TYPE_FCP], NULL); tport->lport = NULL; - call_rcu(&tport->rcu, ft_tport_rcu_free); + kfree_rcu(tport, rcu); ft_tport_count--; }