Add missing stuff from get_param in PP
Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
parent
f86287ef06
commit
e8fc2c24f1
@ -121,7 +121,12 @@ ocf_error_t nhit_get_param(ocf_promotion_policy_t policy, uint8_t param_id,
|
|||||||
case ocf_nhit_insertion_threshold:
|
case ocf_nhit_insertion_threshold:
|
||||||
*param_value = env_atomic_read(&ctx->insertion_threshold);
|
*param_value = env_atomic_read(&ctx->insertion_threshold);
|
||||||
break;
|
break;
|
||||||
|
case ocf_nhit_trigger_threshold:
|
||||||
|
*param_value = OCF_DIV_ROUND_UP(
|
||||||
|
env_atomic64_read(&ctx->trigger_threshold) * 100,
|
||||||
|
ocf_metadata_get_cachelines_count(policy->owner)
|
||||||
|
);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ocf_cache_log(policy->owner, log_err, "Invalid nhit "
|
ocf_cache_log(policy->owner, log_err, "Invalid nhit "
|
||||||
"promotion policy parameter (%u)!\n",
|
"promotion policy parameter (%u)!\n",
|
||||||
|
@ -18,6 +18,7 @@ struct promotion_policy_ops ocf_promotion_policies[ocf_promotion_max] = {
|
|||||||
.init = nhit_init,
|
.init = nhit_init,
|
||||||
.deinit = nhit_deinit,
|
.deinit = nhit_deinit,
|
||||||
.set_param = nhit_set_param,
|
.set_param = nhit_set_param,
|
||||||
|
.get_param = nhit_get_param,
|
||||||
.req_purge = nhit_req_purge,
|
.req_purge = nhit_req_purge,
|
||||||
.req_should_promote = nhit_req_should_promote,
|
.req_should_promote = nhit_req_should_promote,
|
||||||
},
|
},
|
||||||
@ -89,7 +90,7 @@ ocf_error_t ocf_promotion_set_param(ocf_promotion_policy_t policy,
|
|||||||
uint8_t param_id, uint64_t param_value)
|
uint8_t param_id, uint64_t param_value)
|
||||||
{
|
{
|
||||||
ocf_promotion_t type = policy->type;
|
ocf_promotion_t type = policy->type;
|
||||||
ocf_error_t result = 0;
|
ocf_error_t result = -OCF_ERR_INVAL;
|
||||||
|
|
||||||
ENV_BUG_ON(type >= ocf_promotion_max);
|
ENV_BUG_ON(type >= ocf_promotion_max);
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ ocf_error_t ocf_promotion_get_param(ocf_promotion_policy_t policy,
|
|||||||
uint8_t param_id, uint64_t *param_value)
|
uint8_t param_id, uint64_t *param_value)
|
||||||
{
|
{
|
||||||
ocf_promotion_t type = policy->type;
|
ocf_promotion_t type = policy->type;
|
||||||
ocf_error_t result = 0;
|
ocf_error_t result = -OCF_ERR_INVAL;
|
||||||
|
|
||||||
ENV_BUG_ON(type >= ocf_promotion_max);
|
ENV_BUG_ON(type >= ocf_promotion_max);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user