Adapt to new OCF PP param set/get API.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
@@ -854,7 +854,7 @@ int set_param_promotion_nhit_handle_option(char *opt, const char **arg)
|
||||
strtoul(arg[0], NULL, 10));
|
||||
} else if (!strcmp(opt, "trigger")) {
|
||||
if (validate_str_num(arg[0], "trigger",
|
||||
OCF_NHIT_MIN_TRIGGER, OCF_NHIT_MAX_THRESHOLD)) {
|
||||
OCF_NHIT_MIN_TRIGGER, OCF_NHIT_MAX_TRIGGER)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
@@ -378,8 +378,8 @@ int cache_mngt_get_promotion_policy(ocf_cache_t cache, uint32_t *type)
|
||||
return result;
|
||||
}
|
||||
|
||||
int cache_mngt_set_promotion_param(ocf_cache_t cache, uint32_t param_id,
|
||||
uint32_t param_value)
|
||||
int cache_mngt_set_promotion_param(ocf_cache_t cache, ocf_promotion_t type,
|
||||
uint32_t param_id, uint32_t param_value)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -388,14 +388,15 @@ int cache_mngt_set_promotion_param(ocf_cache_t cache, uint32_t param_id,
|
||||
return result;
|
||||
}
|
||||
|
||||
result = ocf_mngt_cache_promotion_set_param(cache, param_id, param_value);
|
||||
result = ocf_mngt_cache_promotion_set_param(cache, type, param_id,
|
||||
param_value);
|
||||
|
||||
ocf_mngt_cache_unlock(cache);
|
||||
return result;
|
||||
}
|
||||
|
||||
int cache_mngt_get_promotion_param(ocf_cache_t cache, uint32_t param_id,
|
||||
uint32_t *param_value)
|
||||
int cache_mngt_get_promotion_param(ocf_cache_t cache, ocf_promotion_t type,
|
||||
uint32_t param_id, uint32_t *param_value)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -404,7 +405,8 @@ int cache_mngt_get_promotion_param(ocf_cache_t cache, uint32_t param_id,
|
||||
return result;
|
||||
}
|
||||
|
||||
result = ocf_mngt_cache_promotion_get_param(cache, param_id, param_value);
|
||||
result = ocf_mngt_cache_promotion_get_param(cache, type, param_id,
|
||||
param_value);
|
||||
|
||||
ocf_mngt_cache_read_unlock(cache);
|
||||
return result;
|
||||
@@ -2199,11 +2201,11 @@ int cache_mngt_set_cache_params(struct kcas_set_cache_param *info)
|
||||
result = cache_mngt_set_promotion_policy(cache, info->param_value);
|
||||
break;
|
||||
case cache_param_promotion_nhit_insertion_threshold:
|
||||
result = cache_mngt_set_promotion_param(cache,
|
||||
result = cache_mngt_set_promotion_param(cache, ocf_promotion_nhit,
|
||||
ocf_nhit_insertion_threshold, info->param_value);
|
||||
break;
|
||||
case cache_param_promotion_nhit_trigger_threshold:
|
||||
result = cache_mngt_set_promotion_param(cache,
|
||||
result = cache_mngt_set_promotion_param(cache, ocf_promotion_nhit,
|
||||
ocf_nhit_trigger_threshold, info->param_value);
|
||||
break;
|
||||
default:
|
||||
@@ -2264,14 +2266,12 @@ int cache_mngt_get_cache_params(struct kcas_get_cache_param *info)
|
||||
result = cache_mngt_get_promotion_policy(cache, &info->param_value);
|
||||
break;
|
||||
case cache_param_promotion_nhit_insertion_threshold:
|
||||
result = cache_mngt_get_promotion_param(cache,
|
||||
ocf_nhit_insertion_threshold,
|
||||
&info->param_value);
|
||||
result = cache_mngt_get_promotion_param(cache, ocf_promotion_nhit,
|
||||
ocf_nhit_insertion_threshold, &info->param_value);
|
||||
break;
|
||||
case cache_param_promotion_nhit_trigger_threshold:
|
||||
result = cache_mngt_get_promotion_param(cache,
|
||||
ocf_nhit_trigger_threshold,
|
||||
&info->param_value);
|
||||
result = cache_mngt_get_promotion_param(cache, ocf_promotion_nhit,
|
||||
ocf_nhit_trigger_threshold, &info->param_value);
|
||||
break;
|
||||
default:
|
||||
result = -EINVAL;
|
||||
|
@@ -24,11 +24,11 @@ int cache_mngt_set_promotion_policy(ocf_cache_t cache, uint32_t type);
|
||||
|
||||
int cache_mngt_get_promotion_policy(ocf_cache_t cache, uint32_t *type);
|
||||
|
||||
int cache_mngt_set_promotion_param(ocf_cache_t cache, uint32_t param_id,
|
||||
uint32_t param_value);
|
||||
int cache_mngt_set_promotion_param(ocf_cache_t cache, ocf_promotion_t type,
|
||||
uint32_t param_id, uint32_t param_value);
|
||||
|
||||
int cache_mngt_get_promotion_param(ocf_cache_t cache, uint32_t param_id,
|
||||
uint32_t *param_value);
|
||||
int cache_mngt_get_promotion_param(ocf_cache_t cache, ocf_promotion_t type,
|
||||
uint32_t param_id, uint32_t *param_value);
|
||||
|
||||
int cache_mngt_add_core_to_cache(const char *cache_name, size_t name_len,
|
||||
struct ocf_mngt_core_config *cfg,
|
||||
|
@@ -332,10 +332,10 @@ static int _cas_upgrade_dump_cache_conf_promotion(ocf_cache_t cache,
|
||||
|
||||
if (promotion_type == ocf_promotion_nhit) {
|
||||
result |= cache_mngt_get_promotion_param(cache,
|
||||
ocf_nhit_insertion_threshold,
|
||||
ocf_promotion_nhit, ocf_nhit_insertion_threshold,
|
||||
&nhit_insertion_threshold);
|
||||
result |= cache_mngt_get_promotion_param(cache,
|
||||
ocf_nhit_trigger_threshold,
|
||||
ocf_promotion_nhit, ocf_nhit_trigger_threshold,
|
||||
&nhit_trigger_threshold);
|
||||
}
|
||||
|
||||
@@ -1199,16 +1199,16 @@ static int _cas_upgrade_restore_conf_promotion(struct cas_properties *cache_prop
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = cache_mngt_set_promotion_param(cache, ocf_nhit_insertion_threshold,
|
||||
nhit_insertion_threshold);
|
||||
result = cache_mngt_set_promotion_param(cache, ocf_promotion_nhit,
|
||||
ocf_nhit_insertion_threshold, nhit_insertion_threshold);
|
||||
if (result) {
|
||||
printk(KERN_ERR OCF_PREFIX_SHORT "Couldn't set NHIT insertion "
|
||||
"threshold parameter \n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = cache_mngt_set_promotion_param(cache, ocf_nhit_trigger_threshold,
|
||||
nhit_trigger_threshold);
|
||||
result = cache_mngt_set_promotion_param(cache, ocf_promotion_nhit,
|
||||
ocf_nhit_trigger_threshold, nhit_trigger_threshold);
|
||||
if (result) {
|
||||
printk(KERN_ERR OCF_PREFIX_SHORT "Couldn't set NHIT trigger "
|
||||
"threshold parameter \n");
|
||||
|
2
ocf
2
ocf
Submodule ocf updated: 79a2d866ae...5113542c7f
Reference in New Issue
Block a user