Rework volume type management

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2021-09-02 22:00:34 +02:00
parent a2bef43975
commit e31e7283d9
5 changed files with 61 additions and 12 deletions

View File

@@ -220,7 +220,8 @@ int ocf_mngt_core_init_front_volume(ocf_core_t core)
};
int ret;
type = ocf_ctx_get_volume_type(cache->owner, 0);
type = ocf_ctx_get_volume_type_internal(cache->owner,
OCF_VOLUME_TYPE_CORE);
if (!type)
return -OCF_ERR_INVAL;

View File

@@ -27,13 +27,18 @@ int ocf_mngt_core_pool_get_count(ocf_ctx_t ctx)
int ocf_mngt_core_pool_add(ocf_ctx_t ctx, ocf_uuid_t uuid, uint8_t type)
{
ocf_volume_type_t volume_type;
ocf_volume_t volume;
int result = 0;
OCF_CHECK_NULL(ctx);
result = ocf_ctx_volume_create(ctx, &volume, uuid, type);
volume_type = ocf_ctx_get_volume_type(ctx, type);
if (!volume_type)
return -OCF_ERR_INVAL;
result = ocf_volume_create(&volume, volume_type, uuid);
if (result)
return result;