From 31737ee0e7a8ad31cc487f2bb8f9431a39fad351 Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Tue, 15 Jun 2021 20:09:09 +0200 Subject: [PATCH] Move all eviction locks to lru.c this is preparation for removal of evp abstraction Signed-off-by: Adam Rutkowski --- src/eviction/lru.c | 5 ++++- src/eviction/ops.h | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/eviction/lru.c b/src/eviction/lru.c index 6d597cc..965e603 100644 --- a/src/eviction/lru.c +++ b/src/eviction/lru.c @@ -289,10 +289,13 @@ void evp_lru_rm_cline(ocf_cache_t cache, ocf_cache_line_t cline) ENV_BUG_ON(part_id > OCF_USER_IO_CLASS_MAX); part = &cache->user_parts[part_id].part; + OCF_METADATA_EVICTION_WR_LOCK(cline); + list = evp_get_cline_list(cache, cline); free = evp_lru_get_list(&cache->free, ev_list, true); - evp_lru_move(cache, cline, part, list, &cache->free, free); + + OCF_METADATA_EVICTION_WR_UNLOCK(cline); } static void evp_lru_repart_locked(ocf_cache_t cache, ocf_cache_line_t cline, diff --git a/src/eviction/ops.h b/src/eviction/ops.h index 76bec9a..ca6622d 100644 --- a/src/eviction/ops.h +++ b/src/eviction/ops.h @@ -36,9 +36,7 @@ static inline void ocf_eviction_purge_cache_line( ENV_BUG_ON(type >= ocf_eviction_max); if (likely(evict_policy_ops[type].rm_cline)) { - OCF_METADATA_EVICTION_WR_LOCK(line); evict_policy_ops[type].rm_cline(cache, line); - OCF_METADATA_EVICTION_WR_UNLOCK(line); } }