nvmf: move the virtual mode related code to the virtual.c.
Change-Id: Ia68ffdd2019adba3a37295ee455e93f8e0427fa2 Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
This commit is contained in:
parent
fca35b7b96
commit
6da9e1792a
@ -84,17 +84,7 @@ subsystem_delete_event(void *arg1, void *arg2)
|
|||||||
static void
|
static void
|
||||||
nvmf_tgt_delete_subsystem(struct nvmf_tgt_subsystem *app_subsys)
|
nvmf_tgt_delete_subsystem(struct nvmf_tgt_subsystem *app_subsys)
|
||||||
{
|
{
|
||||||
struct spdk_nvmf_subsystem *subsystem = app_subsys->subsystem;
|
|
||||||
struct spdk_event *event;
|
struct spdk_event *event;
|
||||||
int i;
|
|
||||||
|
|
||||||
if (spdk_nvmf_subsystem_get_type(subsystem) == SPDK_NVMF_SUBTYPE_NVME &&
|
|
||||||
spdk_nvmf_subsystem_get_mode(subsystem) == NVMF_SUBSYSTEM_MODE_VIRTUAL) {
|
|
||||||
for (i = 0; i < subsystem->dev.virt.ns_count; i++) {
|
|
||||||
spdk_put_io_channel(subsystem->dev.virt.ch[i]);
|
|
||||||
subsystem->dev.virt.ch[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unregister the poller - this starts a chain of events that will eventually free
|
* Unregister the poller - this starts a chain of events that will eventually free
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
#include "spdk/bdev.h"
|
#include "spdk/bdev.h"
|
||||||
#include "spdk/endian.h"
|
#include "spdk/endian.h"
|
||||||
|
#include "spdk/io_channel.h"
|
||||||
#include "spdk/nvme.h"
|
#include "spdk/nvme.h"
|
||||||
#include "spdk/nvmf_spec.h"
|
#include "spdk/nvmf_spec.h"
|
||||||
#include "spdk/trace.h"
|
#include "spdk/trace.h"
|
||||||
@ -528,9 +529,15 @@ nvmf_virtual_ctrlr_detach(struct spdk_nvmf_subsystem *subsystem)
|
|||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
for (i = 0; i < subsystem->dev.virt.ns_count; i++) {
|
for (i = 0; i < subsystem->dev.virt.ns_count; i++) {
|
||||||
|
if (subsystem->dev.virt.ns_list[i]) {
|
||||||
|
spdk_put_io_channel(subsystem->dev.virt.ch[i]);
|
||||||
spdk_bdev_unclaim(subsystem->dev.virt.ns_list[i]);
|
spdk_bdev_unclaim(subsystem->dev.virt.ns_list[i]);
|
||||||
|
subsystem->dev.virt.ch[i] = NULL;
|
||||||
|
subsystem->dev.virt.ns_list[i] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
subsystem->dev.virt.ns_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nvmf_virtual_ctrlr_set_aer_callback(struct spdk_nvmf_subsystem *subsys)
|
nvmf_virtual_ctrlr_set_aer_callback(struct spdk_nvmf_subsystem *subsys)
|
||||||
|
Loading…
Reference in New Issue
Block a user