Use cline concurrency ctx instead of cache
Cacheline concurrency functions have their interface changed so that the cacheline concurrency private context is explicitly on the parameter list, rather than being taken from cache->device->concurrency.cache_line. Cache pointer is no longer provided as a parameter to these functions. Cacheline concurrency context now has a pointer to cache structure (for logging purposes only). 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:
@@ -43,7 +43,9 @@ static void __set_cache_line_invalid(struct ocf_cache *cache, uint8_t start_bit,
|
||||
* for this cache line which will use one, clear
|
||||
* only valid bits
|
||||
*/
|
||||
if (!is_valid && !ocf_cache_line_are_waiters(cache, line)) {
|
||||
if (!is_valid && !ocf_cache_line_are_waiters(
|
||||
cache->device->concurrency.cache_line,
|
||||
line)) {
|
||||
ocf_purge_eviction_policy(cache, line);
|
||||
ocf_metadata_remove_cache_line(cache, line);
|
||||
}
|
||||
|
@@ -213,7 +213,9 @@ static int _ocf_cleaner_cache_line_lock(struct ocf_request *req)
|
||||
|
||||
OCF_DEBUG_TRACE(req->cache);
|
||||
|
||||
return ocf_req_async_lock_rd(req, _ocf_cleaner_on_resume);
|
||||
return ocf_req_async_lock_rd(
|
||||
req->cache->device->concurrency.cache_line,
|
||||
req, _ocf_cleaner_on_resume);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -224,7 +226,8 @@ static void _ocf_cleaner_cache_line_unlock(struct ocf_request *req)
|
||||
{
|
||||
if (req->info.cleaner_cache_line_lock) {
|
||||
OCF_DEBUG_TRACE(req->cache);
|
||||
ocf_req_unlock(req);
|
||||
ocf_req_unlock(req->cache->device->concurrency.cache_line,
|
||||
req);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user