diff --git a/src/mngt/ocf_mngt_cache.c b/src/mngt/ocf_mngt_cache.c index d658d04..2add57e 100644 --- a/src/mngt/ocf_mngt_cache.c +++ b/src/mngt/ocf_mngt_cache.c @@ -328,8 +328,6 @@ static void _ocf_mngt_close_all_uninitialized_cores( cache->core[i].counters = NULL; cache->core[i].added = false; } - - cache->conf_meta->core_count = 0; } /** @@ -350,9 +348,6 @@ static void _ocf_mngt_load_add_cores(ocf_pipeline_t pipeline, OCF_ASSERT_PLUGGED(cache); - /* Count value will be re-calculated on the basis of 'valid' flag */ - cache->conf_meta->core_count = 0; - /* Check in metadata which cores were saved in cache metadata */ for_each_core_metadata(cache, core, core_id) { struct ocf_metadata_uuid *muuid; @@ -401,7 +396,6 @@ static void _ocf_mngt_load_add_cores(ocf_pipeline_t pipeline, } core->added = true; - cache->conf_meta->core_count++; core->volume.cache = cache; if (ocf_mngt_core_init_front_volume(core)) @@ -1969,7 +1963,6 @@ static void _ocf_mngt_cache_stop_remove_cores(ocf_cache_t cache, bool attached) if (--no == 0) break; } - ENV_BUG_ON(cache->conf_meta->core_count != 0); } static void ocf_mngt_cache_stop_remove_cores(ocf_pipeline_t pipeline, @@ -2995,8 +2988,6 @@ static void _ocf_mngt_cache_unplug(ocf_cache_t cache, bool stop, struct _ocf_mngt_cache_unplug_context *context, _ocf_mngt_cache_unplug_end_t cmpl, void *priv) { - ENV_BUG_ON(stop && cache->conf_meta->core_count != 0); - context->cmpl = cmpl; context->priv = priv; context->cache = cache; diff --git a/src/mngt/ocf_mngt_common.c b/src/mngt/ocf_mngt_common.c index d779779..5305521 100644 --- a/src/mngt/ocf_mngt_common.c +++ b/src/mngt/ocf_mngt_common.c @@ -118,6 +118,7 @@ void cache_mngt_core_remove_from_meta(ocf_core_t core) core->conf_meta->seq_no = OCF_SEQ_NO_INVALID; env_bit_clear(core_id, cache->conf_meta->valid_core_bitmap); + cache->conf_meta->core_count--; ocf_metadata_end_exclusive_access(&cache->metadata.lock); } @@ -134,8 +135,6 @@ void cache_mngt_core_remove_from_cache(ocf_core_t core) if (!core->opened && --cache->ocf_core_inactive_count == 0) env_bit_clear(ocf_cache_state_incomplete, &cache->cache_state); - - cache->conf_meta->core_count--; } void ocf_mngt_cache_put(ocf_cache_t cache)