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:

committed by
Michal Mielewczyk

parent
460cd461d3
commit
8b93b699c3
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user