Add volume_params argument to bottom volume open
This pointer is used to provide optional volume specific data from the user down to bottom volume open callback. volume_params is provided to OCF in ocf_mngt_cache_device_config.volume_params. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -412,7 +412,7 @@ static int _ocf_mngt_init_instance_add_cores(
|
||||
ocf_cache_log(cache, log_info,
|
||||
"Attached core %u from pool\n", i);
|
||||
} else {
|
||||
ret = ocf_volume_open(&core->volume);
|
||||
ret = ocf_volume_open(&core->volume, NULL);
|
||||
if (ret == -OCF_ERR_NOT_OPEN_EXC) {
|
||||
ocf_cache_log(cache, log_warn,
|
||||
"Cannot open core %u. "
|
||||
@@ -616,7 +616,8 @@ static void _ocf_mngt_attach_cache_device(ocf_pipeline_t pipeline,
|
||||
* Open cache device, It has to be done first because metadata service
|
||||
* need to know size of cache device.
|
||||
*/
|
||||
ret = ocf_volume_open(&cache->device->volume);
|
||||
ret = ocf_volume_open(&cache->device->volume,
|
||||
context->cfg.volume_params);
|
||||
if (ret) {
|
||||
ocf_cache_log(cache, log_err, "ERROR: Cache not available\n");
|
||||
goto err;
|
||||
@@ -1123,7 +1124,7 @@ int ocf_mngt_get_ram_needed(ocf_cache_t cache,
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
result = ocf_volume_open(&volume);
|
||||
result = ocf_volume_open(&volume, cfg->volume_params);
|
||||
if (result) {
|
||||
ocf_volume_deinit(&volume);
|
||||
return result;
|
||||
|
@@ -38,7 +38,7 @@ static int _ocf_mngt_cache_try_add_core(ocf_cache_t cache, ocf_core_t *core,
|
||||
goto error_out;
|
||||
}
|
||||
|
||||
result = ocf_volume_open(volume);
|
||||
result = ocf_volume_open(volume, NULL);
|
||||
if (result)
|
||||
goto error_out;
|
||||
|
||||
@@ -187,7 +187,7 @@ static void _ocf_mngt_cache_add_core(ocf_cache_t cache,
|
||||
}
|
||||
}
|
||||
|
||||
result = ocf_volume_open(volume);
|
||||
result = ocf_volume_open(volume, NULL);
|
||||
if (result) {
|
||||
ocf_pipeline_finish(context->pipeline, result);
|
||||
return;
|
||||
@@ -417,7 +417,7 @@ int ocf_mngt_core_init_front_volume(ocf_core_t core)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return ocf_volume_open(&core->front_volume);
|
||||
return ocf_volume_open(&core->front_volume, NULL);
|
||||
}
|
||||
|
||||
static void ocf_mngt_cache_add_core_prepare(ocf_pipeline_t pipeline,
|
||||
|
@@ -38,7 +38,7 @@ int ocf_mngt_core_pool_add(ocf_ctx_t ctx, ocf_uuid_t uuid, uint8_t type)
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
result = ocf_volume_open(volume);
|
||||
result = ocf_volume_open(volume, NULL);
|
||||
if (result) {
|
||||
ocf_volume_deinit(volume);
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user