Adapt ioclasses stats command to ocf stats builder.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk
2019-08-29 08:25:16 -04:00
parent 30a52587f3
commit 1abb1e7c72
4 changed files with 54 additions and 364 deletions

View File

@@ -1865,10 +1865,8 @@ int cache_mngt_get_io_class_info(struct kcas_io_class *part)
{
int result;
uint16_t cache_id = part->cache_id;
uint16_t core_id = part->core_id;
uint32_t io_class_id = part->class_id;
ocf_cache_t cache;
ocf_core_t core;
result = mngt_get_cache_by_id(cas_ctx, cache_id, &cache);
if (result)
@@ -1884,17 +1882,6 @@ int cache_mngt_get_io_class_info(struct kcas_io_class *part)
if (result)
goto end;
if (part->get_stats) {
result = get_core_by_id(cache, core_id, &core);
if (result < 0) {
result = OCF_ERR_CORE_NOT_AVAIL;
goto end;
}
result = ocf_core_io_class_get_stats(core, io_class_id,
&part->stats);
}
end:
ocf_mngt_cache_read_unlock(cache);
ocf_mngt_cache_put(cache);