Skip to content

Commit

Permalink
Disable standby mode
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
  • Loading branch information
mmichal10 committed Sep 6, 2024
1 parent 5ef09fb commit d18136b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion casadm/cas_main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -2373,7 +2374,7 @@ static cli_command cas_commands[] = {
.options = standby_params_options,
.command_handle_opts = standby_handle_option,
.handle = standby_handle,
.flags = CLI_SU_REQUIRED,
.flags = (CLI_COMMAND_BLOCKED | CLI_SU_REQUIRED),
.help = standby_help,
},
{
Expand Down
18 changes: 18 additions & 0 deletions modules/cas_cache/layer_cache_management.c
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,15 @@ int cache_mngt_create_cache_cfg(struct ocf_mngt_cache_config *cfg,
char cache_name[OCF_CACHE_NAME_SIZE];
uint16_t cache_id;

switch (cmd->init_cache) {
case CACHE_INIT_STANDBY_NEW:
case CACHE_INIT_STANDBY_LOAD:
printk(KERN_ERR "Standby mode is not supported!\n");
return -ENOTSUP;
default:
break;
}

if (!cmd)
return -OCF_ERR_INVAL;

Expand Down Expand Up @@ -2453,6 +2462,15 @@ int cache_mngt_init_instance(struct ocf_mngt_cache_config *cfg,
ocf_cache_mode_t cache_mode_meta;
ocf_cache_line_size_t cache_line_size_meta;

switch (cmd->init_cache) {
case CACHE_INIT_STANDBY_NEW:
case CACHE_INIT_STANDBY_LOAD:
printk(KERN_ERR "Standby mode is not supported!\n");
return -ENOTSUP;
default:
break;
}

if (!try_module_get(THIS_MODULE))
return -KCAS_ERR_SYSTEM;

Expand Down
5 changes: 5 additions & 0 deletions modules/cas_cache/service_ui_ioctl.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -381,6 +382,8 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd,
case KCAS_IOCTL_STANDBY_DETACH: {
struct kcas_standby_detach *cmd_info;

return -ENOTSUP;

GET_CMD_INFO(cmd_info, arg);

retval = cache_mngt_standby_detach(cmd_info);
Expand All @@ -391,6 +394,8 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd,
struct kcas_standby_activate *cmd_info;
struct ocf_mngt_cache_standby_activate_config cfg;

return -ENOTSUP;

GET_CMD_INFO(cmd_info, arg);

retval = cache_mngt_create_cache_standby_activate_cfg(&cfg,
Expand Down

0 comments on commit d18136b

Please sign in to comment.