Eliminate queue -> cache mapping

Eliminate need to resolve cache based on the queue. This allows to share
the queue between cache instances. The queue still holds pointer to
a cache that owns the queue, but no management or io path relies on the
queue -> cache mapping.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
Robert Baldyga
2024-02-19 22:25:57 +01:00
committed by Michal Mielewczyk
parent 460cd461d3
commit 8b93b699c3
11 changed files with 98 additions and 32 deletions

View File

@@ -40,9 +40,10 @@
static struct ocf_request *_ocf_cleaner_alloc_req(struct ocf_cache *cache,
uint32_t count, const struct ocf_cleaner_attribs *attribs)
{
struct ocf_request *req = ocf_req_new_cleaner(attribs->io_queue, count);
struct ocf_request *req;
int ret;
req = ocf_req_new_cleaner(cache, attribs->io_queue, count);
if (!req)
return NULL;

View File

@@ -105,7 +105,7 @@ int ocf_parallelize_create(ocf_parallelize_t *parallelize,
} else {
queue = cache->mngt_queue;
}
tmp_parallelize->reqs[i] = ocf_req_new_mngt(queue);
tmp_parallelize->reqs[i] = ocf_req_new_mngt(cache, queue);
if (!tmp_parallelize->reqs[i]) {
result = -OCF_ERR_NO_MEM;
goto err_reqs;

View File

@@ -87,7 +87,7 @@ int ocf_pipeline_create(ocf_pipeline_t *pipeline, ocf_cache_t cache,
tmp_pipeline->priv = (void *)priv;
}
req = ocf_req_new_mngt(cache->mngt_queue);
req = ocf_req_new_mngt(cache, cache->mngt_queue);
if (!req) {
env_vfree(tmp_pipeline);
return -OCF_ERR_NO_MEM;