Introduce ocf_lru_add_free() function

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2022-01-14 17:16:21 +01:00
parent b82d30a0ef
commit a947127f55
2 changed files with 10 additions and 0 deletions

View File

@ -1027,3 +1027,12 @@ uint32_t ocf_lru_num_free(ocf_cache_t cache)
{
return env_atomic_read(&cache->free.runtime->curr_size);
}
void ocf_lru_add_free(ocf_cache_t cache, ocf_cache_line_t cline)
{
uint32_t lru_list = (cline % OCF_NUM_LRU_LISTS);
struct ocf_lru_list *list;
list = ocf_lru_get_list(&cache->free, lru_list, true);
add_lru_head_nobalance(cache, list, cline);
}

View File

@ -30,6 +30,7 @@ void ocf_lru_clean(ocf_cache_t cache, struct ocf_user_part *user_part,
ocf_queue_t io_queue, uint32_t count);
void ocf_lru_repart(ocf_cache_t cache, ocf_cache_line_t cline,
struct ocf_part *src_upart, struct ocf_part *dst_upart);
void ocf_lru_add_free(ocf_cache_t cache, ocf_cache_line_t cline);
uint32_t ocf_lru_num_free(ocf_cache_t cache);
void ocf_lru_populate(ocf_cache_t cache, ocf_cache_line_t num_free_clines);
struct ocf_lru_list *ocf_lru_get_list(struct ocf_part *part,