Re: [PATCH, RFC] target: remove ->put_session method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/2/15, 11:54 PM, "Christoph Hellwig" <hch@xxxxxx> wrote:

>The only instance of ->put_session is in qla2xxx, and was added by commit
>aaf68b ("tcm_qla2xxx: Convert to TFO->put_session() usage") with the
>following
>description:
>
>    This patch converts tcm_qla2xxx code to use an internal kref_put() for
>    se_session->sess_kref in order to ensure that
>qla_hw_data->hardware_lock
>    can be held while calling qlt_unreg_sess() for the final put.
>
>But these day we're already holding the hardware lock over qlt_unreg_sess
>in
>the ->close_session callback, so we're fine without this method.
>
>Signed-off-by: Christoph Hellwig <hch@xxxxxx>
>---
> drivers/scsi/qla2xxx/tcm_qla2xxx.c     | 19 -------------------
> drivers/target/target_core_transport.c |  6 ------
> drivers/xen/xen-scsiback.c             |  1 -
> include/target/target_core_fabric.h    |  1 -
> 4 files changed, 27 deletions(-)
>
>diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
>b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
>index ac7a6fe..d20e71d 100644
>--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
>+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
>@@ -789,25 +789,6 @@ static void
>tcm_qla2xxx_clear_nacl_from_fcport_map(struct qla_tgt_sess *sess)
> 	tcm_qla2xxx_clear_sess_lookup(lport, nacl, sess);
> }
> 
>-static void tcm_qla2xxx_release_session(struct kref *kref)
>-{
>-	struct se_session *se_sess = container_of(kref,
>-			struct se_session, sess_kref);
>-
>-	qlt_unreg_sess(se_sess->fabric_sess_ptr);
>-}
>-
>-static void tcm_qla2xxx_put_session(struct se_session *se_sess)
>-{
>-	struct qla_tgt_sess *sess = se_sess->fabric_sess_ptr;
>-	struct qla_hw_data *ha = sess->vha->hw;
>-	unsigned long flags;
>-
>-	spin_lock_irqsave(&ha->hardware_lock, flags);
>-	kref_put(&se_sess->sess_kref, tcm_qla2xxx_release_session);
>-	spin_unlock_irqrestore(&ha->hardware_lock, flags);
>-}
>-
> static void tcm_qla2xxx_put_sess(struct qla_tgt_sess *sess)
> {
> 	if (!sess)
>diff --git a/drivers/target/target_core_transport.c
>b/drivers/target/target_core_transport.c
>index e4a45c9..2f0aa5b 100644
>--- a/drivers/target/target_core_transport.c
>+++ b/drivers/target/target_core_transport.c
>@@ -409,12 +409,6 @@ EXPORT_SYMBOL(target_get_session);
> 
> void target_put_session(struct se_session *se_sess)
> {
>-	struct se_portal_group *tpg = se_sess->se_tpg;
>-
>-	if (tpg->se_tpg_tfo->put_session != NULL) {
>-		tpg->se_tpg_tfo->put_session(se_sess);
>-		return;
>-	}
> 	kref_put(&se_sess->sess_kref, target_release_session);
> }
> EXPORT_SYMBOL(target_put_session);
>diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
>index c1a7ccf..d2e8b26 100644
>--- a/drivers/xen/xen-scsiback.c
>+++ b/drivers/xen/xen-scsiback.c
>@@ -1941,7 +1941,6 @@ static const struct target_core_fabric_ops
>scsiback_ops = {
> 	.tpg_get_inst_index		= scsiback_tpg_get_inst_index,
> 	.check_stop_free		= scsiback_check_stop_free,
> 	.release_cmd			= scsiback_release_cmd,
>-	.put_session			= NULL,
> 	.shutdown_session		= scsiback_shutdown_session,
> 	.close_session			= scsiback_close_session,
> 	.sess_get_index			= scsiback_sess_get_index,
>diff --git a/include/target/target_core_fabric.h
>b/include/target/target_core_fabric.h
>index e541474..08bac29 100644
>--- a/include/target/target_core_fabric.h
>+++ b/include/target/target_core_fabric.h
>@@ -47,7 +47,6 @@ struct target_core_fabric_ops {
> 	 */
> 	int (*check_stop_free)(struct se_cmd *);
> 	void (*release_cmd)(struct se_cmd *);
>-	void (*put_session)(struct se_session *);
> 	/*
> 	 * Called with spin_lock_bh(struct se_portal_group->session_lock held.
> 	 */
>-- 
>1.9.1

Thanks Chris. Looks Good.

Acked-By: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx>

>
>--
>To unsubscribe from this list: send the line "unsubscribe target-devel" in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux