Added create/activate/free all exported objects methods

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
Michal Rakowski
2019-07-16 16:09:50 +02:00
parent 47a150644c
commit ee6cba515a
5 changed files with 40 additions and 1 deletions

View File

@@ -884,6 +884,16 @@ int block_dev_activate_exported_object(ocf_core_t core)
return ret;
}
static int _block_dev_activate_exported_object(ocf_core_t core, void *cntx)
{
return block_dev_activate_exported_object(core);
}
int block_dev_activate_all_exported_objects(ocf_cache_t cache)
{
return ocf_core_visit(cache, _block_dev_activate_exported_object, NULL,
true);
}
int block_dev_create_exported_object(ocf_core_t core)
{
ocf_volume_t obj = ocf_core_get_volume(core);
@@ -915,6 +925,15 @@ int block_dev_create_exported_object(ocf_core_t core)
return result;
}
static int _block_dev_create_exported_object_visitor(ocf_core_t core, void *cntx){
return block_dev_create_exported_object(core);
}
int block_dev_create_all_exported_objects(ocf_cache_t cache)
{
return ocf_core_visit(cache, _block_dev_create_exported_object_visitor, NULL,
true);
}
int block_dev_destroy_exported_object(ocf_core_t core)
{
int ret = 0;
@@ -1016,3 +1035,17 @@ int block_dev_destroy_all_exported_objects(ocf_cache_t cache)
return 0;
}
static int _block_dev_free_exported_object(ocf_core_t core, void *cntx)
{
struct bd_object *bvol = bd_object(
ocf_core_get_volume(core));
casdisk_functions.casdsk_exp_obj_free(bvol->dsk);
return 0;
}
int block_dev_free_all_exported_objects(ocf_cache_t cache)
{
return ocf_core_visit(cache, _block_dev_free_exported_object, NULL,
true);
}