iscsi: Move asynchronous subsystem init to event_iscsi
This removes a dependency on the event framework. Change-Id: Iac8e21b76012a949115e6b793bed89cac14a236c Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/365725 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
4d8c07901f
commit
199e4862d2
@ -37,6 +37,22 @@
|
||||
|
||||
#include "spdk_internal/event.h"
|
||||
|
||||
static void
|
||||
spdk_iscsi_subsystem_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = spdk_iscsi_init();
|
||||
|
||||
spdk_subsystem_init_next(rc);
|
||||
}
|
||||
|
||||
static int
|
||||
spdk_iscsi_subsystem_fini(void)
|
||||
{
|
||||
return spdk_iscsi_fini();
|
||||
}
|
||||
|
||||
SPDK_SUBSYSTEM_REGISTER(iscsi, spdk_iscsi_subsystem_init, spdk_iscsi_subsystem_fini,
|
||||
spdk_iscsi_config_text)
|
||||
SPDK_SUBSYSTEM_DEPEND(iscsi, scsi)
|
||||
|
@ -326,8 +326,8 @@ extern struct spdk_iscsi_globals g_spdk_iscsi;
|
||||
|
||||
struct spdk_iscsi_task;
|
||||
|
||||
void spdk_iscsi_subsystem_init(void);
|
||||
int spdk_iscsi_subsystem_fini(void);
|
||||
int spdk_iscsi_init(void);
|
||||
int spdk_iscsi_fini(void);
|
||||
void spdk_iscsi_config_text(FILE *fp);
|
||||
|
||||
int spdk_iscsi_send_nopin(struct spdk_iscsi_conn *conn);
|
||||
|
@ -963,37 +963,33 @@ spdk_iscsi_setup(void *arg1, void *arg2)
|
||||
spdk_iscsi_acceptor_start();
|
||||
}
|
||||
|
||||
void
|
||||
spdk_iscsi_subsystem_init(void)
|
||||
int
|
||||
spdk_iscsi_init(void)
|
||||
{
|
||||
int rc = 0;
|
||||
int rc;
|
||||
|
||||
rc = spdk_iscsi_app_read_parameters();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_app_read_parameters() failed\n");
|
||||
rc = -1;
|
||||
goto end;
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = spdk_iscsi_initialize_all_pools();
|
||||
if (rc != 0) {
|
||||
SPDK_ERRLOG("spdk_initialize_all_pools() failed\n");
|
||||
rc = -1;
|
||||
goto end;
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = spdk_iscsi_init_tgt_nodes();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_iscsi_init_tgt_nodes() failed\n");
|
||||
rc = -1;
|
||||
goto end;
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = spdk_initialize_iscsi_conns();
|
||||
if (rc < 0) {
|
||||
SPDK_ERRLOG("spdk_initialize_iscsi_conns() failed\n");
|
||||
rc = -1;
|
||||
goto end;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1001,12 +997,11 @@ spdk_iscsi_subsystem_init(void)
|
||||
*/
|
||||
spdk_event_call(spdk_event_allocate(spdk_env_get_current_core(), spdk_iscsi_setup, NULL, NULL));
|
||||
|
||||
end:
|
||||
spdk_subsystem_init_next(rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
spdk_iscsi_subsystem_fini(void)
|
||||
spdk_iscsi_fini(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user