Adding synchronization primitives destroyers

Environment should provide calls for destroying primitives (i.e. env_mutex_destroy()) and OCF should call these functions in its cleanup paths.

Signed-off-by: Firas Medini <mdnfiras@yahoo.com>
This commit is contained in:
Firas Medini
2019-08-13 05:13:11 -07:00
parent 34c8d135c2
commit 1f979f630b
16 changed files with 58 additions and 189 deletions

View File

@@ -73,6 +73,8 @@ void ocf_metadata_deinit(struct ocf_cache *cache)
cache->metadata.iface.deinit(cache);
}
ocf_metadata_concurrency_deinit(cache);
ocf_metadata_io_deinit(cache);
}

View File

@@ -129,6 +129,8 @@ int raw_dynamic_deinit(ocf_cache_t cache,
for (i = 0; i < raw->ssd_pages; i++)
env_secure_free(ctrl->pages[i], PAGE_SIZE);
env_mutex_destroy(&ctrl->lock);
env_vfree(ctrl);
raw->priv = NULL;

View File

@@ -33,6 +33,7 @@ void ocf_metadata_updater_kick(ocf_cache_t cache)
void ocf_metadata_updater_stop(ocf_cache_t cache)
{
ctx_metadata_updater_stop(cache->owner, &cache->metadata_updater);
env_mutex_destroy(&cache->metadata_updater.syncher.lock);
}
void ocf_metadata_updater_set_priv(ocf_metadata_updater_t mu, void *priv)