Remove calls to OCF_METADATA_(UN)LOCK_WR(RD)

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2019-08-01 16:54:26 -04:00
parent 2333d837fb
commit d2bd807e49
11 changed files with 48 additions and 72 deletions

View File

@@ -113,17 +113,17 @@ ocf_cache_line_t ocf_metadata_get_cachelines_count(ocf_cache_t cache)
void ocf_metadata_flush_all(ocf_cache_t cache,
ocf_metadata_end_t cmpl, void *priv)
{
OCF_METADATA_LOCK_WR();
ocf_metadata_start_exclusive_access(&cache->metadata.lock);
cache->metadata.iface.flush_all(cache, cmpl, priv);
OCF_METADATA_UNLOCK_WR();
ocf_metadata_end_exclusive_access(&cache->metadata.lock);
}
void ocf_metadata_load_all(ocf_cache_t cache,
ocf_metadata_end_t cmpl, void *priv)
{
OCF_METADATA_LOCK_WR();
ocf_metadata_start_exclusive_access(&cache->metadata.lock);
cache->metadata.iface.load_all(cache, cmpl, priv);
OCF_METADATA_UNLOCK_WR();
ocf_metadata_end_exclusive_access(&cache->metadata.lock);
}
void ocf_metadata_load_recovery(ocf_cache_t cache,

View File

@@ -1903,7 +1903,7 @@ static void _recovery_rebuild_metadata(ocf_pipeline_t pipeline,
const uint64_t collision_table_entries =
ocf_metadata_collision_table_entries(cache);
OCF_METADATA_LOCK_WR();
ocf_metadata_start_exclusive_access(&cache->metadata.lock);
for (cline = 0; cline < collision_table_entries; cline++) {
ocf_metadata_get_core_info(cache, cline, &core_id, &core_line);
@@ -1923,7 +1923,7 @@ static void _recovery_rebuild_metadata(ocf_pipeline_t pipeline,
OCF_COND_RESCHED(step, 128);
}
OCF_METADATA_UNLOCK_WR();
ocf_metadata_end_exclusive_access(&cache->metadata.lock);
ocf_pipeline_next(pipeline);
}

View File

@@ -226,9 +226,9 @@ static int ocf_restart_meta_io(struct ocf_request *req)
int ret;
/* Fill with the latest metadata. */
OCF_METADATA_LOCK_RD();
/* TODO: synchronize with concurrent metadata io and hash bucket locks
*/
metadata_io_req_fill(meta_io_req);
OCF_METADATA_UNLOCK_RD();
io = ocf_new_cache_io(cache, req->io_queue,
PAGES_TO_BYTES(meta_io_req->page),