Call completion if failed to perform cleaning

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2021-12-08 14:50:50 +01:00
parent aac21cab63
commit d6f2998890

View File

@ -256,18 +256,22 @@ static inline void ocf_cleaning_perform_cleaning(ocf_cache_t cache,
{
ocf_cleaning_t policy;
if (unlikely(!ocf_refcnt_inc(&cache->cleaner.refcnt)))
if (unlikely(!ocf_refcnt_inc(&cache->cleaner.refcnt))) {
cmpl(&cache->cleaner, 1000);
return;
}
policy = cache->cleaner.policy;
ENV_BUG_ON(policy >= ocf_cleaning_max);
if (unlikely(!cleaning_policy_ops[policy].perform_cleaning))
goto unlock;
if (unlikely(!cleaning_policy_ops[policy].perform_cleaning)) {
ocf_refcnt_dec(&cache->cleaner.refcnt);
cmpl(&cache->cleaner, 1000);
return;
}
cleaning_policy_ops[policy].perform_cleaning(cache, cmpl);
unlock:
ocf_refcnt_dec(&cache->cleaner.refcnt);
}