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

@@ -392,7 +392,7 @@ static ocf_cache_line_t _acp_trylock_dirty(struct ocf_cache *cache,
struct ocf_map_info info;
bool locked = false;
OCF_METADATA_LOCK_RD();
ocf_metadata_hash_lock_rd(&cache->metadata.lock, core_id, core_line);
ocf_engine_lookup_map_entry(cache, &info, core_id,
core_line);
@@ -403,7 +403,7 @@ static ocf_cache_line_t _acp_trylock_dirty(struct ocf_cache *cache,
locked = true;
}
OCF_METADATA_UNLOCK_RD();
ocf_metadata_hash_unlock_rd(&cache->metadata.lock, core_id, core_line);
return locked ? info.coll_idx : cache->device->collision_table_entries;
}

View File

@@ -779,7 +779,7 @@ static void alru_clean(struct alru_flush_ctx *fctx)
return;
}
if (OCF_METADATA_LOCK_WR_TRY()) {
if (ocf_metadata_try_start_exclusive_access(&cache->metadata.lock)) {
alru_clean_complete(fctx, 0);
return;
}
@@ -797,7 +797,7 @@ static void alru_clean(struct alru_flush_ctx *fctx)
fctx->flush_perfomed = true;
ocf_cleaner_do_flush_data_async(cache, fctx->flush_data, to_clean,
&fctx->attribs);
OCF_METADATA_UNLOCK_WR();
ocf_metadata_end_exclusive_access(&cache->metadata.lock);
return;
}
@@ -806,7 +806,7 @@ static void alru_clean(struct alru_flush_ctx *fctx)
env_ticks_to_secs(env_get_tick_count());
end:
OCF_METADATA_UNLOCK_WR();
ocf_metadata_end_exclusive_access(&cache->metadata.lock);
alru_clean_complete(fctx, 0);
}