qla2xxx: Get rid of redundant qla_tgt_sess.tearing_down
authorRoland Dreier <roland@purestorage.com>
Mon, 16 Jul 2012 18:04:36 +0000 (11:04 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 17 Jul 2012 00:35:25 +0000 (17:35 -0700)
The only place that sets qla_tgt_sess.tearing_down calls
target_splice_sess_cmd_list() immediately afterwards, without dropping
the lock it holds.  That function sets se_session.sess_tearing_down,
so we can get rid of the qla_target-specific flag, and in the one
place that looks at the qla_tgt_sess.tearing_down flag just test
se_session.sess_tearing_down instead.

Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/qla_target.h
drivers/scsi/qla2xxx/tcm_qla2xxx.c

index 77759c78cc21167cb93c002f6f951efeb4cab0db..87b5a330e0bfdbb15cfe65dd5e41209c9cb4f2a9 100644 (file)
@@ -2644,7 +2644,7 @@ static void qlt_do_work(struct work_struct *work)
        sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha,
            atio->u.isp24.fcp_hdr.s_id);
        if (sess) {
-               if (unlikely(sess->tearing_down)) {
+               if (unlikely(sess->se_sess->sess_tearing_down)) {
                        sess = NULL;
                        spin_unlock_irqrestore(&ha->hardware_lock, flags);
                        goto out_term;
index 2953db8b9da06e3f0f7ee0b451a1c518357624ab..170af1571214095fe82db73fa52f520c16a8197b 100644 (file)
@@ -813,7 +813,6 @@ struct qla_tgt_sess {
        unsigned int conf_compl_supported:1;
        unsigned int deleted:1;
        unsigned int local:1;
-       unsigned int tearing_down:1;
 
        struct se_session *se_sess;
        struct scsi_qla_host *vha;
index d85a81776a7873ca93165d4b47353af05024df14..e131d689e57353e6325a74253e5fd7ebe98c92d6 100644 (file)
@@ -464,7 +464,6 @@ static int tcm_qla2xxx_shutdown_session(struct se_session *se_sess)
        vha = sess->vha;
 
        spin_lock_irqsave(&vha->hw->hardware_lock, flags);
-       sess->tearing_down = 1;
        target_splice_sess_cmd_list(se_sess);
        spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);