diff --git a/scst/include/scst.h b/scst/include/scst.h index 8fff1a3c9..49ffeeb36 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -1638,7 +1638,8 @@ void scst_unregister(struct scst_tgt *tgt); * * Parameters: * tgt - target - * atomic - true, if the function called in the atomic context + * atomic - true, if the function called in the atomic context. If false, + * this function will block until the session registration is completed. * initiator_name - remote initiator's name, any NULL-terminated string, * e.g. iSCSI name, which used as the key to found appropriate access * control group. Could be NULL, then "default" group is used. diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index a9e10fda0..c045b2eee 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -616,7 +616,7 @@ static int scst_local_add_adapter(void) sprintf(name, "scstlclhst%d:%d", scst_local_add_host, i); scst_lcl_host->session[i] = scst_register_session( scst_lcl_host->target, - TRUE, name, NULL, NULL); + 0, name, NULL, NULL); if (!scst_lcl_host->session[i]) { printk(KERN_WARNING "scst_register_session failed:\n"); error = -1; diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index e0fe8aba2..9309dcbdb 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1161,26 +1161,6 @@ static int srpt_release_channel(struct srpt_rdma_ch *ch, int destroy_cmid) return destroy_cmid ? 0 : 1; } -static void srpt_register_channel_done(struct scst_session *scst_sess, - void *data, int status) -{ - struct srpt_rdma_ch *ch = data; - - BUG_ON(!ch); - - if (status) { - if (ch->scst_sess) { - scst_unregister_session(ch->scst_sess, 0, NULL); - ch->scst_sess = NULL; - } - printk(KERN_ERR PFX - "%s: Failed to establish sess= %p status= %d\n", - __func__, scst_sess, status); - } - - complete(&ch->scst_sess_done); -} - static int srpt_disconnect_channel(struct srpt_rdma_ch *ch, int dreq) { spin_lock_irq(&ch->spinlock); @@ -1327,19 +1307,15 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, goto destroy_ib; } - init_completion(&ch->scst_sess_done); sprintf(ch->sess_name, "0x%016llx%016llx", (unsigned long long)be64_to_cpu(*(u64 *)ch->i_port_id), (unsigned long long)be64_to_cpu(*(u64 *)(ch->i_port_id + 8))); - ch->scst_sess = - scst_register_session(sdev->scst_tgt, 1, ch->sess_name, - ch, srpt_register_channel_done); - - wait_for_completion(&ch->scst_sess_done); + ch->scst_sess = scst_register_session(sdev->scst_tgt, 0, ch->sess_name, + NULL, NULL); if (!ch->scst_sess) { rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); - printk(KERN_WARNING PFX "Reject failed to create scst sess"); + printk(KERN_WARNING PFX "Failed to create scst sess\n"); goto destroy_ib; } diff --git a/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h index b34533cae..39e99c468 100644 --- a/srpt/src/ib_srpt.h +++ b/srpt/src/ib_srpt.h @@ -142,7 +142,6 @@ struct srpt_rdma_ch { struct list_head active_scmnd_list; u32 active_scmnd_cnt; - struct completion scst_sess_done; struct scst_session *scst_sess; u8 sess_name[32]; };