Replace eviction with lru in metadata structs
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -37,15 +37,15 @@
|
||||
|
||||
#define META_COUNT 128
|
||||
|
||||
static union eviction_policy_meta meta[META_COUNT];
|
||||
static struct ocf_lru_meta meta[META_COUNT];
|
||||
|
||||
struct ocf_cache_line_concurrency *__wrap_ocf_cache_line_concurrency(ocf_cache_t cache)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
union eviction_policy_meta*
|
||||
__wrap_ocf_metadata_get_eviction_policy(ocf_cache_t cache, ocf_cache_line_t line)
|
||||
struct ocf_lru_meta*
|
||||
__wrap_ocf_metadata_get_lru(ocf_cache_t cache, ocf_cache_line_t line)
|
||||
{
|
||||
assert (line < META_COUNT);
|
||||
return &meta[line];
|
||||
@@ -76,12 +76,12 @@ static void check_hot_elems(struct ocf_lru_list *l)
|
||||
unsigned curr = l->head;
|
||||
|
||||
for (i = 0; i < l->num_hot; i++) {
|
||||
assert_int_equal(meta[curr].lru.hot, 1);
|
||||
curr = meta[curr].lru.next;
|
||||
assert_int_equal(meta[curr].hot, 1);
|
||||
curr = meta[curr].next;
|
||||
}
|
||||
for (i = l->num_hot; i < l->num_nodes; i++) {
|
||||
assert_int_equal(meta[curr].lru.hot, 0);
|
||||
curr = meta[curr].lru.next;
|
||||
assert_int_equal(meta[curr].hot, 0);
|
||||
curr = meta[curr].next;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -236,9 +236,9 @@ inline struct ocf_lru_list *__wrap_evp_get_cline_list(ocf_cache_t cache,
|
||||
}
|
||||
|
||||
|
||||
union eviction_policy_meta policy;
|
||||
struct ocf_lru_meta policy;
|
||||
|
||||
union eviction_policy_meta *__wrap_ocf_metadata_get_eviction_policy(
|
||||
struct ocf_lru_meta *__wrap_ocf_metadata_get_lru(
|
||||
struct ocf_cache *cache, ocf_cache_line_t line)
|
||||
{
|
||||
unsigned i, j;
|
||||
@@ -250,17 +250,17 @@ union eviction_policy_meta *__wrap_ocf_metadata_get_eviction_policy(
|
||||
while (test_cases[j][i][current_case] != -1) {
|
||||
if (test_cases[j][i][current_case] == line) {
|
||||
if (j == 0) {
|
||||
policy.lru.prev = -1;
|
||||
policy.prev = -1;
|
||||
} else {
|
||||
policy.lru.prev =
|
||||
policy.prev =
|
||||
test_cases[j - 1][i][current_case];
|
||||
}
|
||||
|
||||
policy.lru.next = test_cases[j + 1][i][current_case];
|
||||
policy.next = test_cases[j + 1][i][current_case];
|
||||
#ifdef DEBUG
|
||||
print_message("[%u] next %u prev %u\n",
|
||||
line, policy.lru.next,
|
||||
policy.lru.prev);
|
||||
line, policy.next,
|
||||
policy.prev);
|
||||
#endif
|
||||
return &policy;
|
||||
}
|
||||
|
Reference in New Issue
Block a user