Fix ocf_lru_repart for freelist partition

ocf_lru_get_list() now returs clean list for freelist partition to
provide common interface regardless of partition type.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski 2021-06-28 17:39:31 +02:00
parent 847f5f1174
commit a1ec40ce10

View File

@ -224,6 +224,9 @@ void ocf_lru_init_cline(ocf_cache_t cache, ocf_cache_line_t cline)
static struct ocf_lru_list *ocf_lru_get_list(struct ocf_part *part,
uint32_t lru_idx, bool clean)
{
if (part->id == PARTITION_FREELIST)
clean = true;
return clean ? &part->runtime->lru[lru_idx].clean :
&part->runtime->lru[lru_idx].dirty;
}
@ -289,8 +292,6 @@ void ocf_lru_rm_cline(ocf_cache_t cache, ocf_cache_line_t cline)
ocf_part_id_t part_id = ocf_metadata_get_partition_id(cache, cline);
struct ocf_part *part = &cache->user_parts[part_id].part;
ENV_BUG_ON(metadata_test_dirty(cache, cline));
ocf_lru_repart(cache, cline, part, &cache->free);
}