From 92d5ad8075480d46987a33989b41c7507b773dfa Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 21 May 2019 17:26:55 +0200 Subject: [PATCH 1/2] Remove unused parameter from ocf_mngt_cache_device_config Signed-off-by: Robert Baldyga --- inc/ocf_mngt.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/inc/ocf_mngt.h b/inc/ocf_mngt.h index 6dea576..fd46b94 100644 --- a/inc/ocf_mngt.h +++ b/inc/ocf_mngt.h @@ -310,12 +310,6 @@ struct ocf_mngt_cache_device_config { */ bool force; - /** - * @brief Minimum free RAM required to start cache. Set during - * cache start procedure - */ - uint64_t min_free_ram; - /** * @brief If set, cache features (like discard) are tested * before starting cache From 2cf2a59584c9eeeea1393698c7157fa8f8234776 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 21 May 2019 18:17:41 +0200 Subject: [PATCH 2/2] Add open_cores parameter to ocf_mngt_cache_device_config Signed-off-by: Robert Baldyga --- inc/ocf_mngt.h | 13 +++++++++++++ src/mngt/ocf_mngt_cache.c | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/inc/ocf_mngt.h b/inc/ocf_mngt.h index fd46b94..bc9a5a5 100644 --- a/inc/ocf_mngt.h +++ b/inc/ocf_mngt.h @@ -301,6 +301,19 @@ struct ocf_mngt_cache_device_config { */ ocf_cache_line_size_t cache_line_size; + /** + * @brief Automatically open core volumes when loading cache + * + * If set to false, cache load will not attempt to open core volumes, + * and so cores will be marked "inactive" unless their volumes were + * earlier added to the core pool. In such case user will be expected + * to add cores later using function ocf_mngt_cache_add_core(). + * + * @note This option is meaningful only with ocf_mngt_cache_load(). + * When used with ocf_mngt_cache_attach() it's ignored. + */ + bool open_cores; + /** * @brief Ignore warnings and start cache * diff --git a/src/mngt/ocf_mngt_cache.c b/src/mngt/ocf_mngt_cache.c index 80818cc..10ba9b4 100644 --- a/src/mngt/ocf_mngt_cache.c +++ b/src/mngt/ocf_mngt_cache.c @@ -413,7 +413,7 @@ static int _ocf_mngt_init_instance_add_cores( core->opened = true; ocf_cache_log(cache, log_info, "Attached core %u from pool\n", i); - } else { + } else if (context->cfg.open_cores) { ret = ocf_volume_open(&core->volume, NULL); if (ret == -OCF_ERR_NOT_OPEN_EXC) { ocf_cache_log(cache, log_warn,