Don't generate core name when adding core to corepool.

When core frome corepool is added to cache, it's old name is loaded and cores
in corepool cannot be referenced by name anyway so new name is not needed.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2019-09-25 12:07:27 -04:00
parent 360a73ae5b
commit 8b0d10952f

View File

@ -534,8 +534,7 @@ int cache_mngt_prepare_core_cfg(struct ocf_mngt_core_config *cfg,
struct kcas_insert_core *cmd_info)
{
struct block_device *bdev;
static char core_name[OCF_CORE_NAME_SIZE];
struct cache_priv *cache_priv;
char core_name[OCF_CORE_NAME_SIZE] = {};
ocf_cache_t cache;
uint16_t core_id;
int result;
@ -546,9 +545,10 @@ int cache_mngt_prepare_core_cfg(struct ocf_mngt_core_config *cfg,
if (cmd_info->core_id == OCF_CORE_MAX) {
result = mngt_get_cache_by_id(cas_ctx, cmd_info->cache_id,
&cache);
if (result)
if (result && result != -OCF_ERR_CACHE_NOT_EXIST) {
return result;
} else if (!result) {
struct cache_priv *cache_priv;
cache_priv = ocf_cache_get_priv(cache);
ocf_mngt_cache_put(cache);
@ -558,6 +558,7 @@ int cache_mngt_prepare_core_cfg(struct ocf_mngt_core_config *cfg,
cmd_info->core_id = core_id;
}
}
snprintf(core_name, sizeof(core_name), "core%d", cmd_info->core_id);