Introduce core_is_dirty mngt method

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
Michal Rakowski
2019-06-25 09:06:32 +02:00
parent 4a6fc035e9
commit b1a6c467a0
3 changed files with 16 additions and 3 deletions

View File

@@ -105,6 +105,11 @@ static void _ocf_mngt_end_flush(ocf_cache_t cache)
env_mutex_unlock(&cache->flush_mutex);
}
bool ocf_mngt_core_is_dirty(ocf_core_t core)
{
return !!env_atomic_read(&core->runtime_meta->dirty_clines);
}
bool ocf_mngt_cache_is_dirty(ocf_cache_t cache)
{
ocf_core_t core;
@@ -113,7 +118,7 @@ bool ocf_mngt_cache_is_dirty(ocf_cache_t cache)
OCF_CHECK_NULL(cache);
for_each_core(cache, core, core_id) {
if (env_atomic_read(&core->runtime_meta->dirty_clines))
if (ocf_mngt_core_is_dirty(core))
return true;
}