Move metadata concurrency to a separate file

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2019-07-24 14:00:05 -04:00
parent aa02f56b05
commit e5bed8825c
9 changed files with 164 additions and 126 deletions

View File

@@ -1053,9 +1053,15 @@ static void _ocf_mngt_attach_prepare_metadata(ocf_pipeline_t pipeline,
OCF_PL_FINISH_RET(context->pipeline, -OCF_ERR_START_CACHE_FAIL);
}
ocf_cache_log(cache, log_debug, "Cache attached\n");
context->flags.attached_metadata_inited = true;
if (ocf_metadata_concurrency_attached_init(cache)) {
ocf_cache_log(cache, log_err, "Failed to initialize attached "
"metadata concurrency\n");
OCF_PL_FINISH_RET(context->pipeline, -OCF_ERR_START_CACHE_FAIL);
}
for (i = 0; i < OCF_IO_CLASS_MAX + 1; ++i) {
cache->user_parts[i].runtime =
&cache->device->runtime_meta->user_parts[i];
@@ -1538,6 +1544,8 @@ static void _ocf_mngt_attach_post_init(ocf_pipeline_t pipeline,
ocf_cleaner_refcnt_unfreeze(cache);
ocf_refcnt_unfreeze(&cache->refcnt.metadata);
ocf_cache_log(cache, log_debug, "Cache attached\n");
ocf_pipeline_next(context->pipeline);
}