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

@@ -163,7 +163,7 @@ static void _ocf_cleaner_set_error(struct ocf_request *req)
return;
}
master->error = -EIO;
master->error = -OCF_ERR_IO;
}
static void _ocf_cleaner_complete_req(struct ocf_request *req)
@@ -273,8 +273,8 @@ static int _ocf_cleaner_fire_flush_cache(struct ocf_request *req)
io = ocf_volume_new_io(&req->cache->device->volume);
if (!io) {
ocf_metadata_error(req->cache);
req->error = -ENOMEM;
return -ENOMEM;
req->error = -OCF_ERR_NO_MEM;
return -OCF_ERR_NO_MEM;
}
ocf_io_configure(io, 0, 0, OCF_WRITE, 0, 0);
@@ -421,7 +421,7 @@ static int _ocf_cleaner_fire_flush_cores(struct ocf_request *req)
io = ocf_new_core_io(cache, core_id);
if (!io) {
_ocf_cleaner_flush_cores_io_end(iter, req, -ENOMEM);
_ocf_cleaner_flush_cores_io_end(iter, req, -OCF_ERR_NO_MEM);
continue;
}
@@ -845,7 +845,7 @@ void ocf_cleaner_fire(struct ocf_cache *cache,
}
if (!master) {
attribs->cmpl_fn(attribs->cmpl_context, -ENOMEM);
attribs->cmpl_fn(attribs->cmpl_context, -OCF_ERR_NO_MEM);
return;
}
@@ -877,7 +877,7 @@ void ocf_cleaner_fire(struct ocf_cache *cache,
/* when request allocation failed stop processing */
if (!req) {
master->error = -ENOMEM;
master->error = -OCF_ERR_NO_MEM;
break;
}

View File

@@ -242,7 +242,7 @@ void ocf_submit_cache_reqs(struct ocf_cache *cache,
if (reqs == 1) {
io = ocf_new_cache_io(cache);
if (!io) {
callback(req, -ENOMEM);
callback(req, -OCF_ERR_NO_MEM);
goto update_stats;
}
@@ -277,7 +277,7 @@ void ocf_submit_cache_reqs(struct ocf_cache *cache,
if (!io) {
/* Finish all IOs which left with ERROR */
for (; i < reqs; i++)
callback(req, -ENOMEM);
callback(req, -OCF_ERR_NO_MEM);
goto update_stats;
}
@@ -342,7 +342,7 @@ void ocf_submit_volume_req(ocf_volume_t volume, struct ocf_request *req,
io = ocf_volume_new_io(volume);
if (!io) {
callback(req, -ENOMEM);
callback(req, -OCF_ERR_NO_MEM);
return;
}