Error codes in IO path changed to OCF-specific

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
Michal Rakowski
2019-05-27 09:49:54 +02:00
parent 8a053c423c
commit 9f4536c6e3
22 changed files with 111 additions and 91 deletions

View File

@@ -244,7 +244,7 @@ int ocf_engine_hndl_req(struct ocf_request *req,
req->io_if = ocf_get_io_if(req_cache_mode);
if (!req->io_if)
return -EINVAL;
return -OCF_ERR_INVAL;
/* Till OCF engine is not synchronous fully need to push OCF request
* to into OCF workers
@@ -263,7 +263,7 @@ int ocf_engine_hndl_fast_req(struct ocf_request *req,
io_if = ocf_get_io_if(req_cache_mode);
if (!io_if)
return -EINVAL;
return -OCF_ERR_INVAL;
switch (req->rw) {
case OCF_READ:

View File

@@ -584,7 +584,7 @@ static int _ocf_engine_refresh(struct ocf_request *req)
ENV_BUG();
} else {
ENV_WARN(true, "Inconsistent request");
req->error = -EINVAL;
req->error = -OCF_ERR_INVAL;
/* Complete request */
req->complete(req, req->error);

View File

@@ -71,8 +71,8 @@ static int _ocf_discard_core(struct ocf_request *req)
io = ocf_volume_new_io(&req->core->volume);
if (!io) {
_ocf_discard_complete_req(req, -ENOMEM);
return -ENOMEM;
_ocf_discard_complete_req(req, -OCF_ERR_NO_MEM);
return -OCF_ERR_NO_MEM;
}
ocf_io_configure(io, SECTORS_TO_BYTES(req->discard.sector),
@@ -112,8 +112,8 @@ static int _ocf_discard_flush_cache(struct ocf_request *req)
io = ocf_volume_new_io(&req->cache->device->volume);
if (!io) {
ocf_metadata_error(req->cache);
_ocf_discard_complete_req(req, -ENOMEM);
return -ENOMEM;
_ocf_discard_complete_req(req, -OCF_ERR_NO_MEM);
return -OCF_ERR_NO_MEM;
}
ocf_io_configure(io, 0, 0, OCF_WRITE, 0, 0);
@@ -261,7 +261,7 @@ int ocf_discard(struct ocf_request *req)
ocf_io_start(req->io);
if (req->rw == OCF_READ) {
req->complete(req, -EINVAL);
req->complete(req, -OCF_ERR_INVAL);
return 0;
}

View File

@@ -132,7 +132,7 @@ static inline void _ocf_read_generic_submit_miss(struct ocf_request *req)
return;
err_alloc:
_ocf_read_generic_miss_complete(req, -ENOMEM);
_ocf_read_generic_miss_complete(req, -OCF_ERR_NO_MEM);
}
static int _ocf_read_generic_do(struct ocf_request *req)