return acl;
}
-static void target_shutdown_sessions(struct se_node_acl *acl, bool acl_stop)
+static void target_shutdown_sessions(struct se_node_acl *acl)
{
struct se_session *sess;
unsigned long flags;
int ret;
- spin_lock_irqsave(&acl->nacl_sess_lock, flags);
- if (acl_stop)
- acl->acl_stop = 1;
restart:
+ spin_lock_irqsave(&acl->nacl_sess_lock, flags);
list_for_each_entry(sess, &acl->acl_sess_list, sess_acl_list) {
if (sess->sess_tearing_down)
continue;
if (!target_get_session(sess))
continue;
- list_del(&sess->sess_acl_list);
+ list_del_init(&sess->sess_acl_list);
spin_unlock_irqrestore(&acl->nacl_sess_lock, flags);
ret = acl->se_tpg->se_tpg_tfo->shutdown_session(sess);
target_put_session(sess);
if (ret)
target_put_session(sess);
- spin_lock_irqsave(&acl->nacl_sess_lock, flags);
goto restart;
}
spin_unlock_irqrestore(&acl->nacl_sess_lock, flags);
list_del(&acl->acl_list);
mutex_unlock(&tpg->acl_node_mutex);
- target_shutdown_sessions(acl, true);
+ target_shutdown_sessions(acl);
target_put_nacl(acl);
/*
/*
* Shutdown all pending sessions to force session reinstatement.
*/
- target_shutdown_sessions(acl, false);
+ target_shutdown_sessions(acl);
pr_debug("Successfully changed queue depth to: %d for Initiator"
" Node: %s on %s Target Portal Group: %u\n", acl->queue_depth,
se_nacl = se_sess->se_node_acl;
if (se_nacl) {
spin_lock_irqsave(&se_nacl->nacl_sess_lock, flags);
- if (se_nacl->acl_stop == 0)
- list_del(&se_sess->sess_acl_list);
+ if (!list_empty(&se_sess->sess_acl_list))
+ list_del_init(&se_sess->sess_acl_list);
/*
* If the session list is empty, then clear the pointer.
* Otherwise, set the struct se_session pointer from the tail