Refactor LRU code to use part rather than part_id

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2020-11-30 20:27:40 +01:00
parent 41a767de97
commit 44efe3e49e
13 changed files with 58 additions and 59 deletions

View File

@@ -563,6 +563,7 @@ int ocf_metadata_hash_init(struct ocf_cache *cache,
for (i = 0; i < OCF_IO_CLASS_MAX + 1; i++) {
cache->user_parts[i].config = &part_config[i];
cache->user_parts[i].runtime = &part_runtime[i];
cache->user_parts[i].id = i;
}
/* Set core metadata */
@@ -1949,7 +1950,7 @@ static void _recovery_rebuild_cline_metadata(ocf_cache_t cache,
ocf_metadata_add_to_collision(cache, core_id, core_line, hash_index,
cache_line);
ocf_eviction_init_cache_line(cache, cache_line, part_id);
ocf_eviction_init_cache_line(cache, cache_line);
ocf_eviction_set_hot_cache_line(cache, cache_line);

View File

@@ -38,8 +38,6 @@ struct ocf_user_part_runtime {
struct ocf_lru_iter {
/* cache object */
ocf_cache_t cache;
/* target partition id */
ocf_part_id_t part_id;
/* target partition */
struct ocf_user_part *part;
/* per-partition cacheline iterator */
@@ -56,6 +54,8 @@ struct ocf_lru_iter {
struct ocf_user_part {
struct ocf_user_part_config *config;
struct ocf_user_part_runtime *runtime;
struct ocf_refcnt cleaning;
ocf_part_id_t id;
struct ocf_lru_iter eviction_clean_iter;
uint32_t next_eviction_list;