Merge pull request #234 from mdnfiras/sync-prim-destroyers
Adding synchronization primitives destroyers
This commit is contained in:
@@ -233,8 +233,13 @@ void cleaning_policy_acp_init_cache_block(struct ocf_cache *cache,
|
||||
|
||||
void cleaning_policy_acp_deinitialize(struct ocf_cache *cache)
|
||||
{
|
||||
struct acp_context *acp;
|
||||
|
||||
_acp_remove_cores(cache);
|
||||
|
||||
acp = cache->cleaner.cleaning_policy_context;
|
||||
env_rwsem_destroy(&acp->chunks_lock);
|
||||
|
||||
env_vfree(cache->cleaner.cleaning_policy_context);
|
||||
cache->cleaner.cleaning_policy_context = NULL;
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ ocf_cache_line_concurrency_init:
|
||||
*/
|
||||
void ocf_cache_line_concurrency_deinit(struct ocf_cache *cache)
|
||||
{
|
||||
int i;
|
||||
struct ocf_cache_line_concurrency *concurrency;
|
||||
|
||||
if (!cache->device->concurrency.cache_line)
|
||||
@@ -143,6 +144,11 @@ void ocf_cache_line_concurrency_deinit(struct ocf_cache *cache)
|
||||
|
||||
concurrency = cache->device->concurrency.cache_line;
|
||||
|
||||
env_rwlock_destroy(&concurrency->lock);
|
||||
|
||||
for (i = 0; i < _WAITERS_LIST_ENTRIES; i++)
|
||||
env_spinlock_destroy(&concurrency->waiters_lsts[i].lock);
|
||||
|
||||
if (concurrency->access)
|
||||
OCF_REALLOC_DEINIT(&concurrency->access,
|
||||
&concurrency->access_limit);
|
||||
|
||||
@@ -12,6 +12,13 @@ void ocf_metadata_concurrency_init(struct ocf_cache *cache)
|
||||
env_rwsem_init(&cache->metadata.lock.collision);
|
||||
}
|
||||
|
||||
void ocf_metadata_concurrency_deinit(struct ocf_cache *cache)
|
||||
{
|
||||
env_spinlock_destroy(&cache->metadata.lock.eviction);
|
||||
env_rwlock_destroy(&cache->metadata.lock.status);
|
||||
env_rwsem_destroy(&cache->metadata.lock.collision);
|
||||
}
|
||||
|
||||
int ocf_metadata_concurrency_attached_init(struct ocf_cache *cache)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
void ocf_metadata_concurrency_init(struct ocf_cache *cache);
|
||||
|
||||
void ocf_metadata_concurrency_deinit(struct ocf_cache *cache);
|
||||
|
||||
int ocf_metadata_concurrency_attached_init(struct ocf_cache *cache);
|
||||
|
||||
static inline void ocf_metadata_eviction_lock(struct ocf_cache *cache)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -135,6 +135,7 @@ void ocf_mngt_cache_put(ocf_cache_t cache)
|
||||
ctx = cache->owner;
|
||||
ocf_metadata_deinit(cache);
|
||||
ocf_mngt_cache_lock_deinit(cache);
|
||||
env_mutex_destroy(&cache->flush_mutex);
|
||||
env_vfree(cache);
|
||||
ocf_ctx_put(ctx);
|
||||
}
|
||||
|
||||
@@ -233,6 +233,8 @@ void ocf_ctx_put(ocf_ctx_t ctx)
|
||||
|
||||
ocf_mngt_core_pool_deinit(ctx);
|
||||
ocf_ctx_unregister_volume_types(ctx);
|
||||
env_rmutex_destroy(&ctx->lock);
|
||||
|
||||
ocf_req_allocator_deinit(ctx);
|
||||
ocf_logger_close(&ctx->logger);
|
||||
env_free(ctx);
|
||||
|
||||
@@ -60,6 +60,7 @@ void ocf_queue_put(ocf_queue_t queue)
|
||||
list_del(&queue->list);
|
||||
queue->ops->stop(queue);
|
||||
ocf_mngt_cache_put(queue->cache);
|
||||
env_spinlock_destroy(&queue->io_list_lock);
|
||||
env_free(queue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,6 +308,7 @@ static void ocf_volume_close_end(void *ctx)
|
||||
env_completion *cmpl = ctx;
|
||||
|
||||
env_completion_complete(cmpl);
|
||||
env_completion_destroy(cmpl);
|
||||
}
|
||||
|
||||
void ocf_volume_close(ocf_volume_t volume)
|
||||
|
||||
@@ -72,6 +72,8 @@ void ocf_async_lock_deinit(struct ocf_async_lock *lock)
|
||||
list_for_each_entry_safe(iter, temp, &lock->waiters, list)
|
||||
list_move_tail(&iter->list, &waiters);
|
||||
env_mutex_unlock(&lock->mutex);
|
||||
|
||||
env_mutex_destroy(&lock->mutex);
|
||||
|
||||
_ocf_async_lock_run_waiters(lock, &waiters, -OCF_ERR_NO_LOCK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user