nvmf: drop nvmf_initialize() and nvmf_shutdown()

These were internal-only APIs; initialize just checks to see that the
pool was initialized (which is already checked internally), and shutdown
just called spdk_nvmf_shutdown_nvme(), which we can call directly.

Change-Id: I95e1b912d61a38fa9934f58df7b1512678303452
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-07-11 17:09:49 -07:00
parent 6dfbcfa883
commit f6d8e3d421
2 changed files with 1 additions and 31 deletions

View File

@ -179,14 +179,6 @@ nvmf_tgt_subsystem_initialize(void)
return rc;
}
/* initialize NVMe/NVMf backend */
SPDK_NOTICELOG("\n*** NVMf Library Init ***\n");
rc = nvmf_initialize();
if (rc < 0) {
SPDK_ERRLOG("nvmf_initialize() failed\n");
return rc;
}
rc = spdk_nvmf_init_nvme();
if (rc < 0) {
fprintf(stderr, "NVMf could not initialize NVMe devices.\n");
@ -206,7 +198,7 @@ static int
nvmf_tgt_subsystem_fini(void)
{
spdk_shutdown_nvmf_subsystems();
nvmf_shutdown();
spdk_nvmf_shutdown_nvme();
spdk_nvmf_host_destroy_all();
spdk_nvmf_port_destroy_all();
spdk_nvmf_rdma_fini();
@ -221,25 +213,6 @@ nvmf_tgt_subsystem_fini(void)
return 0;
}
int
nvmf_initialize(void)
{
if (request_mempool == NULL) {
fprintf(stderr, "NVMf application has not created request mempool!\n");
return -1;
}
return 0;
}
void
nvmf_shutdown(void)
{
SPDK_TRACELOG(SPDK_TRACE_NVMF, "nvmf_shutdown\n");
spdk_nvmf_shutdown_nvme();
}
SPDK_SUBSYSTEM_REGISTER(nvmf, nvmf_tgt_subsystem_initialize, nvmf_tgt_subsystem_fini, NULL)
SPDK_TRACE_REGISTER_FN(nvmf_trace)

View File

@ -114,9 +114,6 @@ nvmf_complete_cmd(void *rsp, const struct spdk_nvme_cpl *cmp);
int nvmf_tgt_init(char *nodebase, int max_queue_depth, int max_conn_per_sess);
int nvmf_initialize(void);
void nvmf_shutdown(void);
extern struct spdk_nvmf_globals g_nvmf_tgt;
#endif /* __NVMF_INTERNAL_H__ */