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:
parent
360a73ae5b
commit
8b0d10952f
@ -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,17 +545,19 @@ 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);
|
||||
|
||||
cache_priv = ocf_cache_get_priv(cache);
|
||||
ocf_mngt_cache_put(cache);
|
||||
core_id = find_free_core_id(cache_priv->core_id_bitmap);
|
||||
if (core_id == OCF_CORE_MAX)
|
||||
return -OCF_ERR_INVAL;
|
||||
|
||||
core_id = find_free_core_id(cache_priv->core_id_bitmap);
|
||||
if (core_id == OCF_CORE_MAX)
|
||||
return -OCF_ERR_INVAL;
|
||||
|
||||
cmd_info->core_id = core_id;
|
||||
cmd_info->core_id = core_id;
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(core_name, sizeof(core_name), "core%d", cmd_info->core_id);
|
||||
|
Loading…
Reference in New Issue
Block a user