Signed-off-by: David Disseldorp <ddiss@xxxxxxx> --- drivers/target/iscsi/iscsi_target_tpg.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 5b5d044..37bc681 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -205,6 +205,37 @@ static void iscsit_clear_tpg_np_login_threads( spin_unlock(&tpg->tpg_np_lock); } +static void iscsit_shutdown_tpg_np_login_thread( + struct iscsi_tpg_np *tpg_np, + struct iscsi_portal_group *tpg) +{ + if (!tpg_np->tpg_np) { + pr_err("struct iscsi_tpg_np->tpg_np is NULL!\n"); + return; + } + + tpg_np->tpg_np->enabled = false; + iscsit_shutdown_np_thread(tpg_np->tpg_np, tpg_np, tpg); +} + +static void iscsit_shutdown_tpg_np_login_threads( + struct iscsi_portal_group *tpg) +{ + struct iscsi_tpg_np *tpg_np; + + spin_lock(&tpg->tpg_np_lock); + list_for_each_entry(tpg_np, &tpg->tpg_gnp_list, tpg_np_list) { + if (!tpg_np->tpg_np) { + pr_err("struct iscsi_tpg_np->tpg_np is NULL!\n"); + continue; + } + spin_unlock(&tpg->tpg_np_lock); + iscsit_shutdown_tpg_np_login_thread(tpg_np, tpg); + spin_lock(&tpg->tpg_np_lock); + } + spin_unlock(&tpg->tpg_np_lock); +} + static int iscsit_enable_tpg_np_login_thread( struct iscsi_tpg_np *tpg_np) { -- 2.1.4 -- 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