Move eviction files to new locations
src/eviction/lru.c -> src/ocf_lru.c src/eviction/lru.h -> src/ocf_lru.h src/eviction/lru_structs.h -> src/ocf_lru_structs.h src/eviction/eviction.c -> src/ocf_space.c src/eviction/eviction.h -> src/ocf_space.h .. as well as corresponding UT files. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com> ... in UT as well Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
7c0f940876
commit
b1143374a8
@ -3,7 +3,7 @@
|
|||||||
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
*/
|
*/
|
||||||
#include "../ocf_cache_priv.h"
|
#include "../ocf_cache_priv.h"
|
||||||
#include "../eviction/eviction.h"
|
#include "../ocf_space.h"
|
||||||
#include "../ocf_queue_priv.h"
|
#include "../ocf_queue_priv.h"
|
||||||
|
|
||||||
#ifndef __OCF_METADATA_CONCURRENCY_H__
|
#ifndef __OCF_METADATA_CONCURRENCY_H__
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "../utils/utils_refcnt.h"
|
#include "../utils/utils_refcnt.h"
|
||||||
#include "../ocf_request.h"
|
#include "../ocf_request.h"
|
||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
#include "../eviction/eviction.h"
|
#include "../ocf_space.h"
|
||||||
|
|
||||||
enum ocf_io_if_type {
|
enum ocf_io_if_type {
|
||||||
/* Public OCF IO interfaces to be set by user */
|
/* Public OCF IO interfaces to be set by user */
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include "../utils/utils_cleaner.h"
|
#include "../utils/utils_cleaner.h"
|
||||||
#include "../utils/utils_user_part.h"
|
#include "../utils/utils_user_part.h"
|
||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
#include "../eviction/eviction.h"
|
#include "../ocf_space.h"
|
||||||
#include "../promotion/promotion.h"
|
#include "../promotion/promotion.h"
|
||||||
#include "../concurrency/ocf_concurrency.h"
|
#include "../concurrency/ocf_concurrency.h"
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include "../utils/utils_list.h"
|
#include "../utils/utils_list.h"
|
||||||
#include "../cleaning/cleaning.h"
|
#include "../cleaning/cleaning.h"
|
||||||
#include "../eviction/eviction.h"
|
#include "../ocf_space.h"
|
||||||
|
|
||||||
#define OCF_NUM_PARTITIONS OCF_USER_IO_CLASS_MAX + 2
|
#define OCF_NUM_PARTITIONS OCF_USER_IO_CLASS_MAX + 2
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#define __METADATA_STRUCTS_H__
|
#define __METADATA_STRUCTS_H__
|
||||||
|
|
||||||
#include "metadata_common.h"
|
#include "metadata_common.h"
|
||||||
#include "../eviction/eviction.h"
|
#include "../ocf_space.h"
|
||||||
#include "../cleaning/cleaning.h"
|
#include "../cleaning/cleaning.h"
|
||||||
#include "../ocf_request.h"
|
#include "../ocf_request.h"
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "../utils/utils_refcnt.h"
|
#include "../utils/utils_refcnt.h"
|
||||||
#include "../utils/utils_async_lock.h"
|
#include "../utils/utils_async_lock.h"
|
||||||
#include "../concurrency/ocf_concurrency.h"
|
#include "../concurrency/ocf_concurrency.h"
|
||||||
#include "../eviction/lru.h"
|
#include "../ocf_lru.h"
|
||||||
#include "../ocf_ctx_priv.h"
|
#include "../ocf_ctx_priv.h"
|
||||||
#include "../cleaning/cleaning.h"
|
#include "../cleaning/cleaning.h"
|
||||||
#include "../promotion/ops.h"
|
#include "../promotion/ops.h"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
#include "../engine/cache_engine.h"
|
#include "../engine/cache_engine.h"
|
||||||
#include "../ocf_request.h"
|
#include "../ocf_request.h"
|
||||||
#include "../eviction/lru.h"
|
#include "../ocf_lru.h"
|
||||||
#include "../ocf_logger_priv.h"
|
#include "../ocf_logger_priv.h"
|
||||||
#include "../ocf_queue_priv.h"
|
#include "../ocf_queue_priv.h"
|
||||||
#include "../engine/engine_common.h"
|
#include "../engine/engine_common.h"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
#include "../engine/cache_engine.h"
|
#include "../engine/cache_engine.h"
|
||||||
#include "../utils/utils_user_part.h"
|
#include "../utils/utils_user_part.h"
|
||||||
#include "../eviction/lru.h"
|
#include "../ocf_lru.h"
|
||||||
#include "ocf_env.h"
|
#include "ocf_env.h"
|
||||||
|
|
||||||
static uint64_t _ocf_mngt_count_user_parts_min_size(struct ocf_cache *cache)
|
static uint64_t _ocf_mngt_count_user_parts_min_size(struct ocf_cache *cache)
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "eviction.h"
|
#include "ocf_space.h"
|
||||||
#include "lru.h"
|
#include "ocf_lru.h"
|
||||||
#include "../utils/utils_cleaner.h"
|
#include "../utils/utils_cleaner.h"
|
||||||
#include "../utils/utils_cache_line.h"
|
#include "../utils/utils_cache_line.h"
|
||||||
#include "../concurrency/ocf_concurrency.h"
|
#include "../concurrency/ocf_concurrency.h"
|
@ -5,8 +5,8 @@
|
|||||||
#ifndef __EVICTION_LRU_H__
|
#ifndef __EVICTION_LRU_H__
|
||||||
#define __EVICTION_LRU_H__
|
#define __EVICTION_LRU_H__
|
||||||
|
|
||||||
#include "eviction.h"
|
#include "ocf_space.h"
|
||||||
#include "lru_structs.h"
|
#include "ocf_lru_structs.h"
|
||||||
|
|
||||||
struct ocf_part;
|
struct ocf_part;
|
||||||
struct ocf_user_part;
|
struct ocf_user_part;
|
@ -3,7 +3,7 @@
|
|||||||
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
* SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "eviction.h"
|
#include "ocf_space.h"
|
||||||
#include "../utils/utils_user_part.h"
|
#include "../utils/utils_user_part.h"
|
||||||
#include "../engine/engine_common.h"
|
#include "../engine/engine_common.h"
|
||||||
|
|
@ -7,8 +7,8 @@
|
|||||||
#define __LAYER_EVICTION_POLICY_H__
|
#define __LAYER_EVICTION_POLICY_H__
|
||||||
|
|
||||||
#include "ocf/ocf.h"
|
#include "ocf/ocf.h"
|
||||||
#include "lru.h"
|
#include "ocf_lru.h"
|
||||||
#include "lru_structs.h"
|
#include "ocf_lru_structs.h"
|
||||||
|
|
||||||
#define OCF_PENDING_EVICTION_LIMIT 512UL
|
#define OCF_PENDING_EVICTION_LIMIT 512UL
|
||||||
|
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
#include "../concurrency/ocf_cache_line_concurrency.h"
|
#include "../concurrency/ocf_cache_line_concurrency.h"
|
||||||
#include "../eviction/eviction.h"
|
#include "../ocf_space.h"
|
||||||
#include "../engine/cache_engine.h"
|
#include "../engine/cache_engine.h"
|
||||||
#include "../ocf_request.h"
|
#include "../ocf_request.h"
|
||||||
#include "../ocf_def_priv.h"
|
#include "../ocf_def_priv.h"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "../ocf_request.h"
|
#include "../ocf_request.h"
|
||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
#include "../engine/cache_engine.h"
|
#include "../engine/cache_engine.h"
|
||||||
#include "../eviction/lru.h"
|
#include "../ocf_lru.h"
|
||||||
#include "utils_user_part.h"
|
#include "utils_user_part.h"
|
||||||
|
|
||||||
static struct ocf_lst_entry *ocf_user_part_lst_getter_valid(
|
static struct ocf_lst_entry *ocf_user_part_lst_getter_valid(
|
||||||
|
@ -16,7 +16,7 @@ MAIN_DIRECTORY_OF_UNIT_TESTS = "../tests/"
|
|||||||
# Paths to all directories, in which tests are stored. All paths should be relative to
|
# Paths to all directories, in which tests are stored. All paths should be relative to
|
||||||
# MAIN_DIRECTORY_OF_UNIT_TESTS
|
# MAIN_DIRECTORY_OF_UNIT_TESTS
|
||||||
DIRECTORIES_WITH_TESTS_LIST = ["cleaning/", "metadata/", "mngt/", "concurrency/", "engine/",
|
DIRECTORIES_WITH_TESTS_LIST = ["cleaning/", "metadata/", "mngt/", "concurrency/", "engine/",
|
||||||
"eviction/", "utils/", "promotion/"]
|
"ocf_space.c/", "ocf_lru.c/", "utils/", "promotion/"]
|
||||||
|
|
||||||
# Paths to all directories containing files with sources. All paths should be relative to
|
# Paths to all directories containing files with sources. All paths should be relative to
|
||||||
# MAIN_DIRECTORY_OF_TESTED_PROJECT
|
# MAIN_DIRECTORY_OF_TESTED_PROJECT
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include "../utils/utils_cleaner.h"
|
#include "../utils/utils_cleaner.h"
|
||||||
#include "../utils/utils_user_part.h"
|
#include "../utils/utils_user_part.h"
|
||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
#include "../eviction/eviction.h"
|
#include "../ocf_space.h"
|
||||||
#include "../promotion/promotion.h"
|
#include "../promotion/promotion.h"
|
||||||
#include "../concurrency/ocf_concurrency.h"
|
#include "../concurrency/ocf_concurrency.h"
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ ocf_mngt_cache_mode_has_lazy_write
|
|||||||
#include "../utils/utils_cache_line.h"
|
#include "../utils/utils_cache_line.h"
|
||||||
#include "../utils/utils_pipeline.h"
|
#include "../utils/utils_pipeline.h"
|
||||||
#include "../concurrency/ocf_concurrency.h"
|
#include "../concurrency/ocf_concurrency.h"
|
||||||
#include "../eviction/lru.h"
|
#include "../ocf_lru.h"
|
||||||
#include "../ocf_ctx_priv.h"
|
#include "../ocf_ctx_priv.h"
|
||||||
#include "../cleaning/cleaning.h"
|
#include "../cleaning/cleaning.h"
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include "../utils/utils_cache_line.h"
|
#include "../utils/utils_cache_line.h"
|
||||||
#include "../utils/utils_pipeline.h"
|
#include "../utils/utils_pipeline.h"
|
||||||
#include "../concurrency/ocf_concurrency.h"
|
#include "../concurrency/ocf_concurrency.h"
|
||||||
#include "../eviction/lru.h"
|
#include "../ocf_lru.h"
|
||||||
#include "../ocf_ctx_priv.h"
|
#include "../ocf_ctx_priv.h"
|
||||||
#include "../cleaning/cleaning.h"
|
#include "../cleaning/cleaning.h"
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
#include "../engine/cache_engine.h"
|
#include "../engine/cache_engine.h"
|
||||||
#include "../utils/utils_user_part.h"
|
#include "../utils/utils_user_part.h"
|
||||||
#include "../eviction/lru.h"
|
#include "../ocf_lru.h"
|
||||||
#include "ocf_env.h"
|
#include "ocf_env.h"
|
||||||
|
|
||||||
#include "mngt/ocf_mngt_io_class.c/ocf_mngt_io_class_generated_wraps.c"
|
#include "mngt/ocf_mngt_io_class.c/ocf_mngt_io_class_generated_wraps.c"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* <tested_file_path>src/eviction/lru.c</tested_file_path>
|
* <tested_file_path>src/ocf_lru.c</tested_file_path>
|
||||||
* <tested_function>_lru_init</tested_function>
|
* <tested_function>_lru_init</tested_function>
|
||||||
* <functions_to_leave>
|
* <functions_to_leave>
|
||||||
* update_lru_head
|
* update_lru_head
|
||||||
@ -23,8 +23,8 @@
|
|||||||
#include <cmocka.h>
|
#include <cmocka.h>
|
||||||
#include "print_desc.h"
|
#include "print_desc.h"
|
||||||
|
|
||||||
#include "eviction.h"
|
#include "ocf_space.h"
|
||||||
#include "lru.h"
|
#include "ocf_lru.h"
|
||||||
#include "ops.h"
|
#include "ops.h"
|
||||||
#include "../utils/utils_cleaner.h"
|
#include "../utils/utils_cleaner.h"
|
||||||
#include "../utils/utils_cache_line.h"
|
#include "../utils/utils_cache_line.h"
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#include "../engine/engine_zero.h"
|
#include "../engine/engine_zero.h"
|
||||||
#include "../ocf_request.h"
|
#include "../ocf_request.h"
|
||||||
|
|
||||||
#include "eviction/lru.c/lru_generated_wraps.c"
|
#include "ocf_lru.c/lru_generated_wraps.c"
|
||||||
|
|
||||||
#define META_COUNT 128
|
#define META_COUNT 128
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* <tested_file_path>src/eviction/lru.c</tested_file_path>
|
* <tested_file_path>src/ocf_lru.c</tested_file_path>
|
||||||
* <tested_function>lru_iter_next</tested_function>
|
* <tested_function>lru_iter_next</tested_function>
|
||||||
* <functions_to_leave>
|
* <functions_to_leave>
|
||||||
* INSERT HERE LIST OF FUNCTIONS YOU WANT TO LEAVE
|
* INSERT HERE LIST OF FUNCTIONS YOU WANT TO LEAVE
|
||||||
@ -26,8 +26,8 @@
|
|||||||
#include <cmocka.h>
|
#include <cmocka.h>
|
||||||
#include "print_desc.h"
|
#include "print_desc.h"
|
||||||
|
|
||||||
#include "eviction.h"
|
#include "ocf_space.h"
|
||||||
#include "lru.h"
|
#include "ocf_lru.h"
|
||||||
#include "../utils/utils_cleaner.h"
|
#include "../utils/utils_cleaner.h"
|
||||||
#include "../utils/utils_cache_line.h"
|
#include "../utils/utils_cache_line.h"
|
||||||
#include "../concurrency/ocf_concurrency.h"
|
#include "../concurrency/ocf_concurrency.h"
|
||||||
@ -35,7 +35,7 @@
|
|||||||
#include "../engine/engine_zero.h"
|
#include "../engine/engine_zero.h"
|
||||||
#include "../ocf_request.h"
|
#include "../ocf_request.h"
|
||||||
|
|
||||||
#include "eviction/lru.c/lru_iter_generated_wraps.c"
|
#include "ocf_lru.c/lru_iter_generated_wraps.c"
|
||||||
|
|
||||||
//#define DEBUG
|
//#define DEBUG
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* <tested_file_path>src/eviction/eviction.c</tested_file_path>
|
* <tested_file_path>src/ocf_space.c</tested_file_path>
|
||||||
* <tested_function>ocf_remap_do</tested_function>
|
* <tested_function>ocf_remap_do</tested_function>
|
||||||
* <functions_to_leave>
|
* <functions_to_leave>
|
||||||
ocf_evict_user_partitions
|
ocf_evict_user_partitions
|
||||||
@ -17,10 +17,10 @@
|
|||||||
#include <cmocka.h>
|
#include <cmocka.h>
|
||||||
#include "print_desc.h"
|
#include "print_desc.h"
|
||||||
|
|
||||||
#include "eviction.h"
|
#include "ocf_space.h"
|
||||||
#include "../utils/utils_user_part.h"
|
#include "../utils/utils_user_part.h"
|
||||||
|
|
||||||
#include "eviction/eviction.c/eviction_generated_wraps.c"
|
#include "ocf_space.c/ocf_space_generated_wraps.c"
|
||||||
|
|
||||||
struct test_cache
|
struct test_cache
|
||||||
{
|
{
|
Loading…
Reference in New Issue
Block a user