From 4536a51f59294d964a296313f9a1b598d4706fd9 Mon Sep 17 00:00:00 2001 From: Jan Musial Date: Tue, 31 Dec 2019 11:31:09 +0100 Subject: [PATCH] Fix init of nhit + code styling Signed-off-by: Jan Musial --- src/promotion/nhit/nhit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/promotion/nhit/nhit.c b/src/promotion/nhit/nhit.c index 510854c..b2d2fc5 100644 --- a/src/promotion/nhit/nhit.c +++ b/src/promotion/nhit/nhit.c @@ -44,6 +44,8 @@ ocf_error_t nhit_init(ocf_cache_t cache) goto dealloc_ctx; cache->promotion_policy->ctx = ctx; + cache->promotion_policy->config = + (void *) &cache->conf_meta->promotion[ocf_promotion_nhit].data; return 0; @@ -201,8 +203,9 @@ bool nhit_req_should_promote(ocf_promotion_policy_t policy, if (occupied_cachelines < OCF_DIV_ROUND_UP( ((uint64_t)cfg->trigger_threshold * - ocf_metadata_get_cachelines_count(policy->owner)), 100)) + ocf_metadata_get_cachelines_count(policy->owner)), 100)) { return true; + } for (i = 0, core_line = req->core_line_first; core_line <= req->core_line_last; core_line++, i++) {