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:
Adam Rutkowski
2021-02-24 17:29:39 -06:00
parent 0f34e46375
commit cf5f82b253
22 changed files with 200 additions and 151 deletions

View File

@@ -33,7 +33,7 @@ static void ocf_read_wo_cache_complete(struct ocf_request *req, int error)
if (req->error)
ocf_engine_error(req, true, "Failed to read data from cache");
ocf_req_unlock_rd(req);
ocf_req_unlock_rd(req->cache->device->concurrency.cache_line, req);
/* Complete request */
req->complete(req, req->error);
@@ -169,7 +169,8 @@ static void _ocf_read_wo_core_complete(struct ocf_request *req, int error)
if (!req->info.dirty_any || req->error) {
OCF_DEBUG_RQ(req, "Completion");
req->complete(req, req->error);
ocf_req_unlock_rd(req);
ocf_req_unlock_rd(req->cache->device->concurrency.cache_line,
req);
ocf_req_put(req);
return;
}
@@ -236,7 +237,9 @@ int ocf_read_wo(struct ocf_request *req)
/* There are mapped cache lines,
* lock request for READ access
*/
lock = ocf_req_async_lock_rd(req, ocf_engine_on_resume);
lock = ocf_req_async_lock_rd(
req->cache->device->concurrency.cache_line,
req, ocf_engine_on_resume);
}
ocf_hb_req_prot_unlock_rd(req); /*- END Metadata RD access -----------------*/