Remove upgrade-in-flight feature

Due to changes in Linux kernel this feature is not working anymore.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2021-08-11 20:33:16 +02:00
parent 5afc8af0e8
commit c968285d9f
24 changed files with 13 additions and 3336 deletions

View File

@@ -56,7 +56,6 @@ OBJS += statistics_view.o
OBJS += statistics_view_raw_csv.o
OBJS += csvparse.o
OBJS += extended_err_msg.o
OBJS += upgrade.o
OBJS += safeclib/memmove_s.o
OBJS += safeclib/memcpy_s.o
OBJS += safeclib/memset_s.o

View File

@@ -21,7 +21,6 @@
#include "cas_lib_utils.h"
#include "safeclib/safe_str_lib.h"
#include <cas_ioctl_codes.h>
#include "upgrade.h"
#include "statistics_view.h"
#define HELP_HEADER OCF_PREFIX_LONG
@@ -1447,8 +1446,7 @@ enum {
script_cmd_min_id = 0,
script_cmd_upgrade = script_cmd_min_id,
script_cmd_check_cache_device,
script_cmd_check_cache_device = script_cmd_min_id,
script_cmd_add_core,
script_cmd_remove_core,
@@ -1478,14 +1476,6 @@ enum {
* script_opt_* .priv fields contains id of commands, where they can be used
*/
static cli_option script_params_options[] = {
[script_cmd_upgrade] = {
.short_name = 0,
.long_name = "upgrade-in-flight",
.args_count = 0,
.arg = NULL,
.priv = 0,
.flags = CLI_COMMAND_HIDDEN,
},
[script_cmd_check_cache_device] = {
.short_name = 0,
.long_name = "check-cache-device",
@@ -1696,8 +1686,6 @@ int script_handle() {
switch (command_args_values.script_subcmd) {
case script_cmd_check_cache_device:
return check_cache_device(command_args_values.cache_device);
case script_cmd_upgrade:
return upgrade_start();
case script_cmd_add_core:
return add_core(
command_args_values.cache_id,

View File

@@ -197,10 +197,6 @@ struct {
"Could not create exported object because file in /dev "
"directory exists"
},
{
KCAS_ERR_IN_UPGRADE,
"Operation not allowed. CAS is in upgrade state"
},
{
KCAS_ERR_UNALIGNED,
"Cache device logical sector size is greater than core device "
@@ -208,9 +204,6 @@ struct {
"on current cache device \nor try other device with the same "
"logical sector size as core device."
},
{
KCAS_ERR_NO_STORED_CONF,
"Internal kernel module error" },
{
KCAS_ERR_ROLLBACK,
"Cannot restore previous configuration"

View File

@@ -1,40 +0,0 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include "cas_lib.h"
#include "cas_lib_utils.h"
#include <cas_ioctl_codes.h>
extern cas_printf_t cas_printf;
int upgrade_start()
{
int fd;
struct kcas_upgrade cmd_info;
if ((fd = open_ctrl_device()) == -1) {
return -1;
}
if (run_ioctl_interruptible_retry(fd, KCAS_IOCTL_UPGRADE, &cmd_info,
"Starting upgrade", 0, OCF_CORE_ID_INVALID) < 0) {
close(fd);
if (OCF_ERR_FLUSHING_INTERRUPTED == cmd_info.ext_err_code) {
return INTERRUPTED;
} else {
cas_printf(LOG_ERR, "Error starting upgrade\n");
print_err(cmd_info.ext_err_code);
return FAILURE;
}
}
close(fd);
return SUCCESS;
}

View File

@@ -1,11 +0,0 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef _UPGRADE_H
#define _UPGRADE_H
int upgrade_start();
#endif