Move dirty ref counter to cache->refcnt aggregate

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2019-04-08 19:39:52 -04:00
parent 555f477248
commit 979f51612f
4 changed files with 11 additions and 9 deletions

View File

@@ -2361,7 +2361,7 @@ static void ocf_mngt_cache_detach_finish(ocf_pipeline_t pipeline,
struct ocf_mngt_cache_detach_context *context = priv;
ocf_cache_t cache = context->cache;
ocf_refcnt_unfreeze(&cache->dirty);
ocf_refcnt_unfreeze(&cache->refcnt.dirty);
if (!error) {
if (!context->cache_write_error) {
@@ -2422,7 +2422,7 @@ void ocf_mngt_cache_detach(ocf_cache_t cache,
context->cache = cache;
/* prevent dirty io */
ocf_refcnt_freeze(&cache->dirty);
ocf_refcnt_freeze(&cache->refcnt.dirty);
ocf_pipeline_next(pipeline);
}

View File

@@ -94,15 +94,15 @@ static void _ocf_mngt_begin_flush(ocf_pipeline_t pipeline, void *priv,
* finish */
env_mutex_lock(&cache->flush_mutex);
ocf_refcnt_freeze(&cache->dirty);
ocf_refcnt_freeze(&cache->refcnt.dirty);
ocf_refcnt_register_zero_cb(&cache->dirty,
ocf_refcnt_register_zero_cb(&cache->refcnt.dirty,
_ocf_mngt_begin_flush_complete, context);
}
static void _ocf_mngt_end_flush(ocf_cache_t cache)
{
ocf_refcnt_unfreeze(&cache->dirty);
ocf_refcnt_unfreeze(&cache->refcnt.dirty);
env_mutex_unlock(&cache->flush_mutex);
}