Additional data type ops: deinit.

While unloading cas_cache module, volume types were deinitialized, although core
pool still wasn't empty. Now this deinitialization can be done after removing
cores from core pool, and before context is freed.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk
2019-08-02 07:38:56 -04:00
parent d59f202df8
commit 202da8140c
6 changed files with 12 additions and 28 deletions

View File

@@ -1126,6 +1126,14 @@ error:
io->end(io, result);
}
static void atomic_dev_deinit(void)
{
if (atomic_io_allocator) {
cas_mpool_destroy(atomic_io_allocator);
atomic_io_allocator = NULL;
}
}
const struct ocf_volume_properties cas_object_atomic_properties = {
.name = "Atomic Writes NVMe",
.io_priv_size = sizeof(struct blkio),
@@ -1148,6 +1156,7 @@ const struct ocf_volume_properties cas_object_atomic_properties = {
.set_data = cas_blk_io_set_data,
.get_data = cas_blk_io_get_data,
},
.deinit = atomic_dev_deinit
};
int atomic_dev_init(void)
@@ -1171,16 +1180,6 @@ int atomic_dev_init(void)
return 0;
}
void atomic_dev_deinit(void)
{
if (atomic_io_allocator) {
cas_mpool_destroy(atomic_io_allocator);
atomic_io_allocator = NULL;
}
ocf_ctx_unregister_volume_type(cas_ctx, ATOMIC_DEVICE_VOLUME);
}
#else
int atomic_dev_init(void)
@@ -1188,8 +1187,4 @@ int atomic_dev_init(void)
return 0;
}
void atomic_dev_deinit(void)
{
}
#endif