Pass cache_id to cache_mng_add_core_to_cache()
struct ocf_mngt_core_config no longer contains this information, so we need to pass it as separate argument. Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
068aaddd4a
commit
077956f9a9
@ -408,7 +408,6 @@ int cache_mng_prepare_core_cfg(struct ocf_mngt_core_config *cfg,
|
||||
cfg->uuid.data = cmd_info->core_path_name;
|
||||
cfg->uuid.size = strnlen(cmd_info->core_path_name, MAX_STR_LEN) + 1;
|
||||
cfg->core_id = cmd_info->core_id;
|
||||
cfg->cache_id = cmd_info->cache_id;
|
||||
cfg->try_add = cmd_info->try_add;
|
||||
|
||||
if (cas_upgrade_is_in_upgrade()) {
|
||||
@ -519,7 +518,7 @@ static void _cache_mng_add_core_complete(ocf_cache_t cache,
|
||||
static void _cache_mng_remove_core_complete(void *priv, int error);
|
||||
|
||||
int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
|
||||
struct kcas_insert_core *cmd_info)
|
||||
ocf_cache_id_t cache_id, struct kcas_insert_core *cmd_info)
|
||||
{
|
||||
struct _cache_mng_add_core_context add_context;
|
||||
struct _cache_mng_sync_context remove_context;
|
||||
@ -528,7 +527,7 @@ int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
|
||||
ocf_core_id_t core_id;
|
||||
int result, remove_core_result;
|
||||
|
||||
result = ocf_mngt_cache_get_by_id(cas_ctx, cfg->cache_id, &cache);
|
||||
result = ocf_mngt_cache_get_by_id(cas_ctx, cache_id, &cache);
|
||||
if (cfg->try_add && (result == -OCF_ERR_CACHE_NOT_EXIST)) {
|
||||
result = ocf_mngt_core_pool_add(cas_ctx, &cfg->uuid,
|
||||
cfg->volume_type);
|
||||
|
@ -21,7 +21,7 @@ int cache_mng_get_cleaning_param(ocf_cache_id_t cache_id, ocf_cleaning_t type,
|
||||
uint32_t param_id, uint32_t *param_value);
|
||||
|
||||
int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
|
||||
struct kcas_insert_core *cmd_info);
|
||||
ocf_cache_id_t cache_id, struct kcas_insert_core *cmd_info);
|
||||
|
||||
int cache_mng_remove_core_from_cache(struct kcas_remove_core *cmd);
|
||||
|
||||
|
@ -959,11 +959,11 @@ static int _cas_upgrade_restore_conf_core(struct cas_properties *cache_props,
|
||||
cfg.try_add = 0;
|
||||
cfg.volume_type = BLOCK_DEVICE_VOLUME;
|
||||
cfg.core_id = core_id_int;
|
||||
cfg.cache_id = ocf_cache_get_id(cache);
|
||||
cfg.uuid.data = core_path;
|
||||
cfg.uuid.size = strnlen(core_path, MAX_STR_LEN) + 1;
|
||||
|
||||
result = cache_mng_add_core_to_cache(&cfg, NULL);
|
||||
result = cache_mng_add_core_to_cache(&cfg,
|
||||
ocf_cache_get_id(cache), NULL);
|
||||
if (result)
|
||||
goto error;
|
||||
}
|
||||
|
@ -177,7 +177,8 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd,
|
||||
if (retval)
|
||||
RETURN_CMD_RESULT(cmd_info, arg, retval);
|
||||
|
||||
retval = cache_mng_add_core_to_cache(&cfg, cmd_info);
|
||||
retval = cache_mng_add_core_to_cache(&cfg, cmd_info->cache_id,
|
||||
cmd_info);
|
||||
|
||||
RETURN_CMD_RESULT(cmd_info, arg, retval);
|
||||
}
|
||||
|
2
ocf
2
ocf
@ -1 +1 @@
|
||||
Subproject commit 7165bc16c3f9c3c6efbd41138fbdf4cf8aaf6262
|
||||
Subproject commit 7d493ae995c3706fe8466f9a5f5c53f6a03401bd
|
Loading…
Reference in New Issue
Block a user