attach: setup promotion policy before cleaning

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2022-09-15 13:16:08 +02:00
parent ca70ea3fff
commit f8e8d74539

View File

@ -1220,6 +1220,8 @@ static void _ocf_mngt_attach_init_services(ocf_pipeline_t pipeline,
ocf_cache_t cache = context->cache;
ocf_error_t result;
__setup_promotion_policy(cache);
if (context->metadata.cleaner_disabled)
__set_cleaning_policy(cache, ocf_cleaning_nop);
@ -1230,8 +1232,6 @@ static void _ocf_mngt_attach_init_services(ocf_pipeline_t pipeline,
OCF_PL_FINISH_RET(pipeline, result);
}
__setup_promotion_policy(cache);
/* In initial cache state there is no dirty data, so all dirty data is
considered to be flushed
*/