Extend ioclass management logging

When setting ioclass, print info about it's max size

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2020-10-29 07:14:43 -04:00
parent c643a41977
commit e9d7290078

View File

@ -136,17 +136,17 @@ static int _ocf_mngt_io_class_configure(ocf_cache_t cache,
/* Try set partition size */ /* Try set partition size */
if (_ocf_mngt_set_partition_size(cache, part_id, min, max)) { if (_ocf_mngt_set_partition_size(cache, part_id, min, max)) {
ocf_cache_log(cache, log_info, ocf_cache_log(cache, log_info,
"Setting IO class size, id: %u, name: '%s' " "Setting IO class size, id: %u, name: '%s', max size: %u"
"[ ERROR ]\n", part_id, dest_part->config->name); " [ ERROR ]\n", part_id, dest_part->config->name, max);
return -OCF_ERR_INVAL; return -OCF_ERR_INVAL;
} }
ocf_part_set_prio(cache, dest_part, prio); ocf_part_set_prio(cache, dest_part, prio);
dest_part->config->cache_mode = cache_mode; dest_part->config->cache_mode = cache_mode;
ocf_cache_log(cache, log_info, ocf_cache_log(cache, log_info,
"Updating unclassified IO class, id: " "Updating unclassified IO class, id: %u, name :'%s',"
"%u [ OK ]\n", part_id); "max size: %u [ OK ]\n",
part_id, dest_part->config->name, max);
return 0; return 0;
} }
@ -160,23 +160,23 @@ static int _ocf_mngt_io_class_configure(ocf_cache_t cache,
/* Try set partition size */ /* Try set partition size */
if (_ocf_mngt_set_partition_size(cache, part_id, min, max)) { if (_ocf_mngt_set_partition_size(cache, part_id, min, max)) {
ocf_cache_log(cache, log_info, ocf_cache_log(cache, log_info,
"Setting IO class size, id: %u, name: '%s' " "Setting IO class size, id: %u, name: '%s', max size %u"
"[ ERROR ]\n", part_id, dest_part->config->name); "[ ERROR ]\n", part_id, dest_part->config->name, max);
return -OCF_ERR_INVAL; return -OCF_ERR_INVAL;
} }
if (ocf_part_is_valid(dest_part)) { if (ocf_part_is_valid(dest_part)) {
/* Updating existing */ /* Updating existing */
ocf_cache_log(cache, log_info, "Updating existing IO " ocf_cache_log(cache, log_info, "Updating existing IO "
"class, id: %u, name: '%s' [ OK ]\n", "class, id: %u, name: '%s', max size %u [ OK ]\n",
part_id, dest_part->config->name); part_id, dest_part->config->name, max);
} else { } else {
/* Adding new */ /* Adding new */
ocf_part_set_valid(cache, part_id, true); ocf_part_set_valid(cache, part_id, true);
ocf_cache_log(cache, log_info, "Adding new IO class, " ocf_cache_log(cache, log_info, "Adding new IO class, "
"id: %u, name: '%s' [ OK ]\n", part_id, "id: %u, name: '%s', max size %u [ OK ]\n", part_id,
dest_part->config->name); dest_part->config->name, max);
} }
ocf_part_set_prio(cache, dest_part, prio); ocf_part_set_prio(cache, dest_part, prio);