Use API instead of raw variables to update error stats.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
0d4f4d3294
commit
b4c384eb2d
@ -61,7 +61,7 @@ static void _ocf_backfill_complete(struct ocf_request *req, int error)
|
||||
req->data = NULL;
|
||||
|
||||
if (req->error) {
|
||||
env_atomic_inc(&req->core->counters->cache_errors.write);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_WRITE);
|
||||
ocf_engine_invalidate(req);
|
||||
} else {
|
||||
ocf_req_unlock(req);
|
||||
|
@ -16,17 +16,13 @@
|
||||
|
||||
static void _ocf_d2c_completion(struct ocf_request *req, int error)
|
||||
{
|
||||
ocf_core_t core = req->core;
|
||||
req->error = error;
|
||||
|
||||
OCF_DEBUG_RQ(req, "Completion");
|
||||
|
||||
if (req->error) {
|
||||
req->info.core_error = 1;
|
||||
if (req->rw == OCF_READ)
|
||||
env_atomic_inc(&core->counters->core_errors.read);
|
||||
else
|
||||
env_atomic_inc(&core->counters->core_errors.write);
|
||||
ocf_core_stats_core_error_update(req->core, req->rw);
|
||||
}
|
||||
|
||||
/* Complete request */
|
||||
|
@ -43,7 +43,7 @@ static void _ocf_read_fast_complete(struct ocf_request *req, int error)
|
||||
if (req->error) {
|
||||
OCF_DEBUG_RQ(req, "ERROR");
|
||||
|
||||
env_atomic_inc(&req->core->counters->cache_errors.read);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_READ);
|
||||
ocf_engine_push_req_front_pt(req);
|
||||
} else {
|
||||
ocf_req_unlock(req);
|
||||
|
@ -20,7 +20,7 @@ static void _ocf_invalidate_req(struct ocf_request *req, int error)
|
||||
{
|
||||
if (error) {
|
||||
req->error = error;
|
||||
env_atomic_inc(&req->core->counters->cache_errors.write);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_WRITE);
|
||||
}
|
||||
|
||||
if (env_atomic_dec_return(&req->req_remaining))
|
||||
|
@ -28,7 +28,7 @@ static void _ocf_read_pt_complete(struct ocf_request *req, int error)
|
||||
|
||||
if (req->error) {
|
||||
req->info.core_error = 1;
|
||||
env_atomic_inc(&req->core->counters->core_errors.read);
|
||||
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
||||
}
|
||||
|
||||
/* Complete request */
|
||||
|
@ -38,7 +38,7 @@ static void _ocf_read_generic_hit_complete(struct ocf_request *req, int error)
|
||||
OCF_DEBUG_RQ(req, "HIT completion");
|
||||
|
||||
if (req->error) {
|
||||
env_atomic_inc(&req->core->counters->cache_errors.read);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_READ);
|
||||
ocf_engine_push_req_front_pt(req);
|
||||
} else {
|
||||
|
||||
@ -77,7 +77,7 @@ static void _ocf_read_generic_miss_complete(struct ocf_request *req, int error)
|
||||
req->complete(req, req->error);
|
||||
|
||||
req->info.core_error = 1;
|
||||
env_atomic_inc(&req->core->counters->core_errors.read);
|
||||
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
||||
|
||||
ctx_data_free(cache->owner, req->cp_data);
|
||||
req->cp_data = NULL;
|
||||
|
@ -24,7 +24,7 @@ static void _ocf_read_wa_complete(struct ocf_request *req, int error)
|
||||
|
||||
if (req->error) {
|
||||
req->info.core_error = 1;
|
||||
env_atomic_inc(&req->core->counters->core_errors.write);
|
||||
ocf_core_stats_core_error_update(req->core, OCF_WRITE);
|
||||
}
|
||||
|
||||
/* Complete request */
|
||||
|
@ -89,7 +89,7 @@ static const struct ocf_io_if _io_if_wb_flush_metadata = {
|
||||
static void _ocf_write_wb_complete(struct ocf_request *req, int error)
|
||||
{
|
||||
if (error) {
|
||||
env_atomic_inc(&req->core->counters->cache_errors.write);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_WRITE);
|
||||
req->error |= error;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ static const struct ocf_io_if _io_if_wi_flush_metadata = {
|
||||
static void _ocf_write_wi_io_flush_metadata(struct ocf_request *req, int error)
|
||||
{
|
||||
if (error) {
|
||||
env_atomic_inc(&req->core->counters->cache_errors.write);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_WRITE);
|
||||
req->error |= error;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ static void _ocf_write_wi_core_complete(struct ocf_request *req, int error)
|
||||
if (error) {
|
||||
req->error = error;
|
||||
req->info.core_error = 1;
|
||||
env_atomic_inc(&req->core->counters->core_errors.write);
|
||||
ocf_core_stats_core_error_update(req->core, OCF_WRITE);
|
||||
}
|
||||
|
||||
if (env_atomic_dec_return(&req->req_remaining))
|
||||
|
@ -21,7 +21,7 @@
|
||||
static void ocf_read_wo_cache_complete(struct ocf_request *req, int error)
|
||||
{
|
||||
if (error) {
|
||||
env_atomic_inc(&req->core->counters->cache_errors.read);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_READ);
|
||||
req->error |= error;
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ static void _ocf_read_wo_core_complete(struct ocf_request *req, int error)
|
||||
if (error) {
|
||||
req->error |= error;
|
||||
req->info.core_error = 1;
|
||||
env_atomic_inc(&req->core->counters->core_errors.read);
|
||||
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
||||
}
|
||||
|
||||
/* if all mapped cachelines are clean, the data we've read from core
|
||||
|
@ -48,7 +48,7 @@ static void _ocf_write_wt_cache_complete(struct ocf_request *req, int error)
|
||||
{
|
||||
if (error) {
|
||||
req->error = req->error ?: error;
|
||||
env_atomic_inc(&req->core->counters->cache_errors.write);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_WRITE);
|
||||
|
||||
if (req->error)
|
||||
inc_fallback_pt_error_counter(req->cache);
|
||||
@ -62,7 +62,7 @@ static void _ocf_write_wt_core_complete(struct ocf_request *req, int error)
|
||||
if (error) {
|
||||
req->error = error;
|
||||
req->info.core_error = 1;
|
||||
env_atomic_inc(&req->core->counters->core_errors.write);
|
||||
ocf_core_stats_core_error_update(req->core, OCF_WRITE);
|
||||
}
|
||||
|
||||
_ocf_write_wt_req_complete(req);
|
||||
|
@ -50,7 +50,7 @@ static const struct ocf_io_if _io_if_zero_purge = {
|
||||
static void _ocf_zero_io_flush_metadata(struct ocf_request *req, int error)
|
||||
{
|
||||
if (error) {
|
||||
env_atomic_inc(&req->core->counters->cache_errors.write);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_WRITE);
|
||||
req->error = error;
|
||||
}
|
||||
|
||||
|
@ -465,8 +465,7 @@ static void _ocf_cleaner_core_io_cmpl(struct ocf_io *io, int error)
|
||||
if (error) {
|
||||
map->invalid |= 1;
|
||||
_ocf_cleaner_set_error(req);
|
||||
env_atomic_inc(&req->cache->core[map->core_id].counters->
|
||||
core_errors.write);
|
||||
ocf_core_stats_core_error_update(req->core, OCF_WRITE);
|
||||
}
|
||||
|
||||
_ocf_cleaner_core_io_end(req);
|
||||
@ -623,8 +622,7 @@ static void _ocf_cleaner_cache_io_cmpl(struct ocf_io *io, int error)
|
||||
if (error) {
|
||||
map->invalid |= 1;
|
||||
_ocf_cleaner_set_error(req);
|
||||
env_atomic_inc(&req->cache->core[map->core_id].counters->
|
||||
cache_errors.read);
|
||||
ocf_core_stats_cache_error_update(req->core, OCF_READ);
|
||||
}
|
||||
|
||||
_ocf_cleaner_cache_io_end(req);
|
||||
|
Loading…
Reference in New Issue
Block a user