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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user