Add getter function for cache->device->concurrency.cache_line

The purpose of this change is to facilitate unit testing.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2021-03-05 11:20:47 +01:00
parent ce2ff14150
commit 1411314678
21 changed files with 49 additions and 46 deletions

View File

@@ -398,7 +398,7 @@ static ocf_cache_line_t _acp_trylock_dirty(struct ocf_cache *cache,
if (info.status == LOOKUP_HIT &&
metadata_test_dirty(cache, info.coll_idx)) {
locked = ocf_cache_line_try_lock_rd(
cache->device->concurrency.cache_line,
ocf_cache_line_concurrency(cache),
info.coll_idx);
}
@@ -474,7 +474,7 @@ static void _acp_flush_end(void *priv, int error)
for (i = 0; i < flush->size; i++) {
ocf_cache_line_unlock_rd(
cache->device->concurrency.cache_line,
ocf_cache_line_concurrency(cache),
flush->data[i].cache_line);
ACP_DEBUG_END(acp, flush->data[i].cache_line);
}

View File

@@ -682,8 +682,7 @@ static bool block_is_busy(struct ocf_cache *cache,
if (!cache->core[core_id].opened)
return true;
if (ocf_cache_line_is_used(
cache->device->concurrency.cache_line,
if (ocf_cache_line_is_used(ocf_cache_line_concurrency(cache),
cache_line)) {
return true;
}