Merge pull request #600 from mmichal10/cleaning-cmpl

Call completion if failed to perform cleaning
This commit is contained in:
Robert Baldyga 2021-12-08 22:00:58 +01:00 committed by GitHub
commit 21c4673251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}