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:
parent
d59f202df8
commit
202da8140c
@ -430,13 +430,11 @@ int cas_initialize_context(void)
|
|||||||
ret = atomic_dev_init();
|
ret = atomic_dev_init();
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printk(KERN_ERR "Cannot initialize atomic device layer\n");
|
printk(KERN_ERR "Cannot initialize atomic device layer\n");
|
||||||
goto err_block_dev;
|
goto err_rpool;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_block_dev:
|
|
||||||
block_dev_deinit();
|
|
||||||
err_rpool:
|
err_rpool:
|
||||||
cas_rpool_destroy(cas_bvec_pages_rpool, _cas_free_page_rpool, NULL);
|
cas_rpool_destroy(cas_bvec_pages_rpool, _cas_free_page_rpool, NULL);
|
||||||
err_mpool:
|
err_mpool:
|
||||||
@ -449,8 +447,6 @@ err_ctx:
|
|||||||
|
|
||||||
void cas_cleanup_context(void)
|
void cas_cleanup_context(void)
|
||||||
{
|
{
|
||||||
block_dev_deinit();
|
|
||||||
atomic_dev_deinit();
|
|
||||||
cas_garbage_collector_deinit();
|
cas_garbage_collector_deinit();
|
||||||
cas_mpool_destroy(cas_bvec_pool);
|
cas_mpool_destroy(cas_bvec_pool);
|
||||||
cas_rpool_destroy(cas_bvec_pages_rpool, _cas_free_page_rpool, NULL);
|
cas_rpool_destroy(cas_bvec_pages_rpool, _cas_free_page_rpool, NULL);
|
||||||
|
@ -1126,6 +1126,14 @@ error:
|
|||||||
io->end(io, result);
|
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 = {
|
const struct ocf_volume_properties cas_object_atomic_properties = {
|
||||||
.name = "Atomic Writes NVMe",
|
.name = "Atomic Writes NVMe",
|
||||||
.io_priv_size = sizeof(struct blkio),
|
.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,
|
.set_data = cas_blk_io_set_data,
|
||||||
.get_data = cas_blk_io_get_data,
|
.get_data = cas_blk_io_get_data,
|
||||||
},
|
},
|
||||||
|
.deinit = atomic_dev_deinit
|
||||||
};
|
};
|
||||||
|
|
||||||
int atomic_dev_init(void)
|
int atomic_dev_init(void)
|
||||||
@ -1171,16 +1180,6 @@ int atomic_dev_init(void)
|
|||||||
return 0;
|
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
|
#else
|
||||||
|
|
||||||
int atomic_dev_init(void)
|
int atomic_dev_init(void)
|
||||||
@ -1188,8 +1187,4 @@ int atomic_dev_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void atomic_dev_deinit(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,6 +26,4 @@ struct atomic_dev_params {
|
|||||||
|
|
||||||
int atomic_dev_init(void);
|
int atomic_dev_init(void);
|
||||||
|
|
||||||
void atomic_dev_deinit(void);
|
|
||||||
|
|
||||||
#endif /* __VOL_ATOMIC_DEV_BOTTOM_H__ */
|
#endif /* __VOL_ATOMIC_DEV_BOTTOM_H__ */
|
||||||
|
@ -565,6 +565,7 @@ const struct ocf_volume_properties cas_object_blk_properties = {
|
|||||||
.set_data = cas_blk_io_set_data,
|
.set_data = cas_blk_io_set_data,
|
||||||
.get_data = cas_blk_io_get_data,
|
.get_data = cas_blk_io_get_data,
|
||||||
},
|
},
|
||||||
|
.deinit = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
int block_dev_init(void)
|
int block_dev_init(void)
|
||||||
@ -578,10 +579,6 @@ int block_dev_init(void)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void block_dev_deinit(void)
|
|
||||||
{
|
|
||||||
ocf_ctx_unregister_volume_type(cas_ctx, BLOCK_DEVICE_VOLUME);
|
|
||||||
}
|
|
||||||
|
|
||||||
int block_dev_try_get_io_class(struct bio *bio, int *io_class)
|
int block_dev_try_get_io_class(struct bio *bio, int *io_class)
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,4 @@ int block_dev_try_get_io_class(struct bio *bio, int *io_class);
|
|||||||
|
|
||||||
int block_dev_init(void);
|
int block_dev_init(void);
|
||||||
|
|
||||||
void block_dev_deinit(void);
|
|
||||||
|
|
||||||
#endif /* __VOL_BLOCK_DEV_BOTTOM_H__ */
|
#endif /* __VOL_BLOCK_DEV_BOTTOM_H__ */
|
||||||
|
2
ocf
2
ocf
@ -1 +1 @@
|
|||||||
Subproject commit bc2084567330a16db660feb0f579210f525dfc2b
|
Subproject commit 0d37d14a364f3ae1bc19638c6a3897e71e547b3e
|
Loading…
Reference in New Issue
Block a user