Use API instead of raw variables to update block stats.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk
2019-09-06 05:02:16 -04:00
parent 51c9c516a4
commit 01ce586e6a
3 changed files with 9 additions and 33 deletions

View File

@@ -453,18 +453,8 @@ void ocf_engine_clean(struct ocf_request *req)
void ocf_engine_update_block_stats(struct ocf_request *req)
{
ocf_part_id_t part_id = req->part_id;
struct ocf_counters_block *blocks;
blocks = &req->core->counters->
part_counters[part_id].blocks;
if (req->rw == OCF_READ)
env_atomic64_add(req->byte_length, &blocks->read_bytes);
else if (req->rw == OCF_WRITE)
env_atomic64_add(req->byte_length, &blocks->write_bytes);
else
ENV_BUG();
ocf_core_stats_vol_block_update(req->core, req->part_id, req->rw,
req->byte_length);
}
void ocf_engine_update_request_stats(struct ocf_request *req)