Skip to content

Commit

Permalink
Add open_cores parameter to ocf_mngt_cache_device_config
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
(cherry picked from commit 2cf2a59)
  • Loading branch information
Robert Baldyga authored and Michal Wysoczanski committed May 27, 2019
1 parent d8df412 commit 515137f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions inc/ocf_mngt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/mngt/ocf_mngt_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,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,
Expand Down

0 comments on commit 515137f

Please sign in to comment.