From 8b0415cfe8ae237764a733e0d90f62c7565d1546 Mon Sep 17 00:00:00 2001 From: xilai Date: Tue, 31 Dec 2024 13:58:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E5=88=B0=20dss=5Fdefs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/dss_defs.c | 136 ++++++++++++++++++++++++++++++++++++++++++ src/common/dss_defs.h | 17 ++++++ src/log/dss_log.c | 110 ---------------------------------- src/log/dss_log.h | 17 ------ 4 files changed, 153 insertions(+), 127 deletions(-) create mode 100644 src/common/dss_defs.c diff --git a/src/common/dss_defs.c b/src/common/dss_defs.c new file mode 100644 index 0000000..6e90cd8 --- /dev/null +++ b/src/common/dss_defs.c @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2022 Huawei Technologies Co.,Ltd. + * + * DSS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * + * http://license.coscl.org.cn/MulanPSL2 + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + * ------------------------------------------------------------------------- + * + * dss_defs.c + * + * + * IDENTIFICATION + * src/common/dss_defs.c + * + * ------------------------------------------------------------------------- + */ + +#include "dss_errno.h" +#include "dss_defs.h" + +/* + * one error no corresponds to one error desc + * Attention: keep the array index same as error no + */ +const char *g_dss_error_desc[DSS_ERROR_COUNT] = { + // Zenith File System, range [2000, 2500] + [ERR_DSS_VG_CREATE] = "Create volume group %s failed, reason %s", + [ERR_DSS_VG_LOCK] = "Lock volume group %s failed", + [ERR_DSS_VG_REMOVE] = "Forbidden remove volume group's superblock", + [ERR_DSS_VG_CHECK] = "Check volume group %s failed, reason %s", + [ERR_DSS_VG_CHECK_NOT_INIT] = "The volume group has not been initialized.", + [ERR_DSS_VG_NOT_EXIST] = "Failed to find volume group %s, please check vg config file.", + [ERR_DSS_VOLUME_SYSTEM_IO] = "Failed to operate volume %s for system I/O error.", + [ERR_DSS_VOLUME_OPEN] = "Open volume '%s' failed, reason %d", + [ERR_DSS_VOLUME_READ] = "Read volume '%s' failed, volume id %d, reason %d", + [ERR_DSS_VOLUME_WRITE] = "Write volume '%s' failed, volume id %d, reason %d", + [ERR_DSS_VOLUME_SEEK] = "Seek volume '%s' failed, volume id %d, reason %d", + [ERR_DSS_VOLUME_ADD] = "Failed to add volume %s, reason %s.", + [ERR_DSS_VOLUME_EXISTED] = "Add/Replace an existed volume %s of volume-group %s failed", + [ERR_DSS_VOLUME_NOEXIST] = "Remove/Replace a non-existent volume %s of volume-group %s failed", + [ERR_DSS_VOLUME_REMOVE_NONEMPTY] = "Remove a nonempty volume %s failed", + [ERR_DSS_VOLUME_REMOVE_SUPER_BLOCK] = "Remove super block %s failed", + [ERR_DSS_VOLUME_REPLACE] = "Failed to replace volume %s, reason %s.", + [ERR_DSS_FILE_SEEK] = "Failed to seek file, vgid:%u, fid:%llu, offset:%lld, file size:%llu", + [ERR_DSS_FILE_REMOVE_OPENING] = "DSS file is open", + [ERR_DSS_FILE_REMOVE_SYSTEM] = "DSS file %s is system file", + [ERR_DSS_FILE_RENAME] = "Rename failed, reason %s", + [ERR_DSS_FILE_RENAME_DIFF_VG] = "Failed to rename from vg %s to another vg %s, function not supported", + [ERR_DSS_FILE_RENAME_EXIST] = "Rename failed, reason %s", + [ERR_DSS_FILE_RENAME_OPENING_REMOTE] = "Failed to rename %s to %s, while source file is opend by other instance.", + [ERR_DSS_FILE_CLOSE] = "Close file failed, reason %s", + [ERR_DSS_FILE_CREATE] = "Create file failed, reason %s", + [ERR_DSS_FILE_RDWR_INSUFF_PER] = "Insufficient permission to %s file, while the permission is %u.", + [ERR_DSS_FILE_NOT_EXIST] = "The file %s of %s does not exist", + [ERR_DSS_FILE_OPENING_REMOTE] = "The file is open in other inst: %hhu, command:%u exec failed.", + [ERR_DSS_FILE_TYPE_MISMATCH] = "The type of directory link or file %s is not matched.", + [ERR_DSS_FILE_PATH_ILL] = "Path %s decode error %s", + [ERR_DSS_FILE_INVALID_SIZE] = "Invalid extend offset %lld, size %d.", + [ERR_DSS_DIR_REMOVE_NOT_EMPTY] = "The dir is not empty, can not remove.", + [ERR_DSS_DIR_CREATE_DUPLICATED] = "Make dir or Create file failed, %s has already existed", + [ERR_DSS_LINK_READ_NOT_LINK] = "The path %s is not a soft link.", + [ERR_DSS_LINK_CREATE] = "Failed to create symbolic link, reason %s", + [ERR_DSS_CONFIG_FILE_OVERSIZED] = "The size of config file %s is too large", + [ERR_DSS_CONFIG_LOAD] = "Please check dss_vg_conf.ini, reason %s", + [ERR_DSS_CONFIG_LINE_OVERLONG] = "The length of row %d is too long", + [ERR_DSS_REDO_ILL] = "DSS redo log error, reason %s", + [ERR_DSS_OAMAP_INSERT] = "Failed to insert hash map ", + [ERR_DSS_OAMAP_INSERT_DUP_KEY] = "Hash map duplicated key", + [ERR_DSS_OAMAP_FETCH] = "Failed to fetch hash map", + [ERR_DSS_SKLIST_ERR] = "Error DSS skip list.", + [ERR_DSS_SKLIST_NOT_INIT] = "Error DSS skip list not init.", + [ERR_DSS_SKLIST_NOT_EXIST] = "Error DSS skip list not exist.", + [ERR_DSS_SKLIST_EXIST] = "Error DSS skip list key value exist.", + [ERR_DSS_SHM_CREATE] = "Failed to create shared memory, key=0x%08x, size=%llu", + [ERR_DSS_SHM_CHECK] = "Failed to check shared memory ctrl, key=0x%08x, reason=%s", + [ERR_DSS_SHM_LOCK] = "Failed to lock vg shared memory, reason=%s", + [ERR_DSS_SHM_LOCK_TIMEOUT] = "Try to get shm lock timeout", + [ERR_DSS_GA_INIT] = "DSS ga init error, reason %s", + [ERR_DSS_GA_GET_ADDR] = "DSS ga get addr error, pool id %d, object id%u.", + [ERR_DSS_GA_ALLOC_OBJECT] = "DSS ga alloc object error, pool id %d.", + [ERR_DSS_SESSION_INVALID_ID] = "Invalid session %d", + [ERR_DSS_SESSION_CREATE] = "Create new DSS session failed, no free sessions, %d sessions used.", + [ERR_DSS_SESSION_EXTEND] = "Extend DSS session failed, reason : %s.", + [ERR_DSS_INVALID_PARAM] = "Invalid DSS parameter: %s", + [ERR_DSS_NO_SPACE] = "DSS no space in the vg", + [ERR_DSS_ENV_NOT_INITIALIZED] = "The DSS env has not been initialized.", + [ERR_DSS_CLI_EXEC_FAIL] = "DSS client exec cmd '%s' failed, reason %s.", + [ERR_DSS_FNODE_CHECK] = "DSS fnode error, reason %s", + [ERR_DSS_LOCK_TIMEOUT] = "DSS lock timeout", + [ERR_DSS_SERVER_IS_DOWN] = "DSS server is down", + [ERR_DSS_CHECK_SIZE] = "Failed to specify size %d which is not aligned with DSS allocate-unit size %d", + [ERR_DSS_MES_ILL] = "DSS message contact error, reason %s", + [ERR_DSS_STRING_TOO_LONG] = "The length(%u) of text can't be larger than %u, text = %s", + [ERR_DSS_TCP_TIMEOUT_REMAIN] = "Waiting for request head(size) timeout, %d bytes remained", + [ERR_DSS_UDS_INVALID_URL] = "Invalid unix domain socket url:%s, length %d. \ + Eg:server_locator=\"UDS:UNIX_emserver.domain\"", + [ERR_DSS_RECV_MSG_FAILED] = "Recv msg failed, errcode:%d, inst:%u.", + [ERR_DSS_INIT_LOGGER_FAILED] = "Log init failed.", + [ERR_DSS_OUT_OF_MEM] = "Failed to apply for memory.", + [ERR_DSS_INVALID_ID] = "Invalid %s id : %llu.", + [ERR_DSS_PROCESS_REMOTE] = "Failed to process remote, errcode: %d, errmsg: %s.", + [ERR_DSS_CONNECT_FAILED] = "Failed to connect dss server, errcode: %d, errmsg: %s.", + [ERR_DSS_VERSION_NOT_MATCH] = + "[CHECK_PROTO]Protocol version need be changed, old protocol version is %u, new protocol version is %u.", + [ERR_DSS_INVALID_BLOCK_TYPE] = "Get Invalid block type, expect type is %u, but the type in share memory is %u.", + [ERR_DSS_SERVER_REBOOT] = "DSS server has reboot or close, dss client need reboot or close.", + [ERR_DSS_UNSUPPORTED_CMD] = "Command \"%s\" is not supported in current version of dssserver.", + [ERR_DSS_VOLUME_FENCE_CHECK_COND] = "Fail to check fence cond:%s.", + [ERR_DSS_HP_NOT_INIT] = "Hotpatch module is not inited.", + [ERR_DSS_HP_LIB_HAS_LOADED] = "The patch has been loaded, don't load it again.", + [ERR_DSS_HP_LIB_NOT_LOADED] = "The patch has not been loaded, please check patch info.", + [ERR_DSS_HP_LIB_IS_ACTIVED] = "The patch has been actived, please check patch info.", + [ERR_DSS_HP_LIB_IS_DEACTIVED] = "The patch has beed deactived, please check patch info.", + [ERR_DSS_HP_LIB_CRC_FAILED] = "Failed to check the CRC of patch file with bin.", + [ERR_DSS_HP_LIB_ERROR] = "Error hotpatch lib, please check run log.", + [ERR_DSS_HP_CANNOT_LOAD] = "Cannot load the patch, please check patch status.", + [ERR_DSS_HP_CANNOT_ACTIVE] = "Cannot active the patch, please check patch status.", + [ERR_DSS_HP_CANNOT_DEACTIVE] = "Cannot deactive the patch, please check patch status.", + [ERR_DSS_HP_CANNOT_UNLOAD] = "Cannot unload the patch, please check patch status.", + [ERR_DSS_HP_PATCH_NUMBER] = "The number of patch has reached its maximum %u.", + [ERR_DSS_HP_CHECKSUM_FAILED] = "Checksum failed when read patch.info file.", + [ERR_DSS_HP_NOT_SUPPORT] = "Hotpatch is not supported in current version.", + [ERR_DSS_HP_LIB_PATCH_CORRUPTED] = "Failed to check patch file CRC, the patch file is corrupted.", + [ERR_DSS_HP_LIB_PATCH_PERMISSION] = "Invalid permission of patch file %s, X00 is expected.", + [ERR_DSS_HP_VERSION_DISMATCH] = "Dismatch between patch info version(%s) and dssserver version(%s).", + [ERR_DSS_HP_PATCH_INFO_LOST] = "Patch info of number %d is lost in patch.info file.", + [ERR_DSS_MASTER_CHANGE] = "Master id has changed.", + [ERR_DSS_RECOVER_CAUSE_BREAK] = "Req break by recovery.", +}; \ No newline at end of file diff --git a/src/common/dss_defs.h b/src/common/dss_defs.h index 3da3ffb..97cd28a 100644 --- a/src/common/dss_defs.h +++ b/src/common/dss_defs.h @@ -204,6 +204,23 @@ extern "C" { #define DSS_DIR_PARENT ".." #define DSS_DIR_SELF "." +#define DSS_ERROR_COUNT 3000 +extern const char *g_dss_error_desc[DSS_ERROR_COUNT]; +#define DSS_THROW_ERROR(error_no, ...) \ + do { \ + if (g_dss_error_desc[error_no] != NULL) \ + cm_set_error((char *)__FILE_NAME__, (uint32)__LINE__, (cm_errno_t)error_no, g_dss_error_desc[error_no], \ + ##__VA_ARGS__); \ + else \ + cm_set_error( \ + (char *)__FILE_NAME__, (uint32)__LINE__, (cm_errno_t)error_no, g_error_desc[error_no], ##__VA_ARGS__); \ + } while (0) + +#define DSS_THROW_ERROR_EX(error_no, format, ...) \ + do { \ + cm_set_error((char *)__FILE_NAME__, (uint32)__LINE__, (cm_errno_t)error_no, format, ##__VA_ARGS__); \ + } while (0) + #define DSS_RETURN_IF_ERROR(ret) \ do { \ int _status_ = (ret); \ diff --git a/src/log/dss_log.c b/src/log/dss_log.c index fe246a2..b7374ae 100644 --- a/src/log/dss_log.c +++ b/src/log/dss_log.c @@ -30,116 +30,6 @@ #include "dss_session.h" #include "cm_system.h" -/* - * one error no corresponds to one error desc - * Attention: keep the array index same as error no - */ -const char *g_dss_error_desc[DSS_ERROR_COUNT] = { - // Zenith File System, range [2000, 2500] - [ERR_DSS_VG_CREATE] = "Create volume group %s failed, reason %s", - [ERR_DSS_VG_LOCK] = "Lock volume group %s failed", - [ERR_DSS_VG_REMOVE] = "Forbidden remove volume group's superblock", - [ERR_DSS_VG_CHECK] = "Check volume group %s failed, reason %s", - [ERR_DSS_VG_CHECK_NOT_INIT] = "The volume group has not been initialized.", - [ERR_DSS_VG_NOT_EXIST] = "Failed to find volume group %s, please check vg config file.", - [ERR_DSS_VOLUME_SYSTEM_IO] = "Failed to operate volume %s for system I/O error.", - [ERR_DSS_VOLUME_OPEN] = "Open volume '%s' failed, reason %d", - [ERR_DSS_VOLUME_READ] = "Read volume '%s' failed, volume id %d, reason %d", - [ERR_DSS_VOLUME_WRITE] = "Write volume '%s' failed, volume id %d, reason %d", - [ERR_DSS_VOLUME_SEEK] = "Seek volume '%s' failed, volume id %d, reason %d", - [ERR_DSS_VOLUME_ADD] = "Failed to add volume %s, reason %s.", - [ERR_DSS_VOLUME_EXISTED] = "Add/Replace an existed volume %s of volume-group %s failed", - [ERR_DSS_VOLUME_NOEXIST] = "Remove/Replace a non-existent volume %s of volume-group %s failed", - [ERR_DSS_VOLUME_REMOVE_NONEMPTY] = "Remove a nonempty volume %s failed", - [ERR_DSS_VOLUME_REMOVE_SUPER_BLOCK] = "Remove super block %s failed", - [ERR_DSS_VOLUME_REPLACE] = "Failed to replace volume %s, reason %s.", - [ERR_DSS_FILE_SEEK] = "Failed to seek file, vgid:%u, fid:%llu, offset:%lld, file size:%llu", - [ERR_DSS_FILE_REMOVE_OPENING] = "DSS file is open", - [ERR_DSS_FILE_REMOVE_SYSTEM] = "DSS file %s is system file", - [ERR_DSS_FILE_RENAME] = "Rename failed, reason %s", - [ERR_DSS_FILE_RENAME_DIFF_VG] = "Failed to rename from vg %s to another vg %s, function not supported", - [ERR_DSS_FILE_RENAME_EXIST] = "Rename failed, reason %s", - [ERR_DSS_FILE_RENAME_OPENING_REMOTE] = "Failed to rename %s to %s, while source file is opend by other instance.", - [ERR_DSS_FILE_CLOSE] = "Close file failed, reason %s", - [ERR_DSS_FILE_CREATE] = "Create file failed, reason %s", - [ERR_DSS_FILE_RDWR_INSUFF_PER] = "Insufficient permission to %s file, while the permission is %u.", - [ERR_DSS_FILE_NOT_EXIST] = "The file %s of %s does not exist", - [ERR_DSS_FILE_OPENING_REMOTE] = "The file is open in other inst: %hhu, command:%u exec failed.", - [ERR_DSS_FILE_TYPE_MISMATCH] = "The type of directory link or file %s is not matched.", - [ERR_DSS_FILE_PATH_ILL] = "Path %s decode error %s", - [ERR_DSS_FILE_INVALID_SIZE] = "Invalid extend offset %lld, size %d.", - [ERR_DSS_DIR_REMOVE_NOT_EMPTY] = "The dir is not empty, can not remove.", - [ERR_DSS_DIR_CREATE_DUPLICATED] = "Make dir or Create file failed, %s has already existed", - [ERR_DSS_LINK_READ_NOT_LINK] = "The path %s is not a soft link.", - [ERR_DSS_LINK_CREATE] = "Failed to create symbolic link, reason %s", - [ERR_DSS_CONFIG_FILE_OVERSIZED] = "The size of config file %s is too large", - [ERR_DSS_CONFIG_LOAD] = "Please check dss_vg_conf.ini, reason %s", - [ERR_DSS_CONFIG_LINE_OVERLONG] = "The length of row %d is too long", - [ERR_DSS_REDO_ILL] = "DSS redo log error, reason %s", - [ERR_DSS_OAMAP_INSERT] = "Failed to insert hash map ", - [ERR_DSS_OAMAP_INSERT_DUP_KEY] = "Hash map duplicated key", - [ERR_DSS_OAMAP_FETCH] = "Failed to fetch hash map", - [ERR_DSS_SKLIST_ERR] = "Error DSS skip list.", - [ERR_DSS_SKLIST_NOT_INIT] = "Error DSS skip list not init.", - [ERR_DSS_SKLIST_NOT_EXIST] = "Error DSS skip list not exist.", - [ERR_DSS_SKLIST_EXIST] = "Error DSS skip list key value exist.", - [ERR_DSS_SHM_CREATE] = "Failed to create shared memory, key=0x%08x, size=%llu", - [ERR_DSS_SHM_CHECK] = "Failed to check shared memory ctrl, key=0x%08x, reason=%s", - [ERR_DSS_SHM_LOCK] = "Failed to lock vg shared memory, reason=%s", - [ERR_DSS_SHM_LOCK_TIMEOUT] = "Try to get shm lock timeout", - [ERR_DSS_GA_INIT] = "DSS ga init error, reason %s", - [ERR_DSS_GA_GET_ADDR] = "DSS ga get addr error, pool id %d, object id%u.", - [ERR_DSS_GA_ALLOC_OBJECT] = "DSS ga alloc object error, pool id %d.", - [ERR_DSS_SESSION_INVALID_ID] = "Invalid session %d", - [ERR_DSS_SESSION_CREATE] = "Create new DSS session failed, no free sessions, %d sessions used.", - [ERR_DSS_SESSION_EXTEND] = "Extend DSS session failed, reason : %s.", - [ERR_DSS_INVALID_PARAM] = "Invalid DSS parameter: %s", - [ERR_DSS_NO_SPACE] = "DSS no space in the vg", - [ERR_DSS_ENV_NOT_INITIALIZED] = "The DSS env has not been initialized.", - [ERR_DSS_CLI_EXEC_FAIL] = "DSS client exec cmd '%s' failed, reason %s.", - [ERR_DSS_FNODE_CHECK] = "DSS fnode error, reason %s", - [ERR_DSS_LOCK_TIMEOUT] = "DSS lock timeout", - [ERR_DSS_SERVER_IS_DOWN] = "DSS server is down", - [ERR_DSS_CHECK_SIZE] = "Failed to specify size %d which is not aligned with DSS allocate-unit size %d", - [ERR_DSS_MES_ILL] = "DSS message contact error, reason %s", - [ERR_DSS_STRING_TOO_LONG] = "The length(%u) of text can't be larger than %u, text = %s", - [ERR_DSS_TCP_TIMEOUT_REMAIN] = "Waiting for request head(size) timeout, %d bytes remained", - [ERR_DSS_UDS_INVALID_URL] = "Invalid unix domain socket url:%s, length %d. \ - Eg:server_locator=\"UDS:UNIX_emserver.domain\"", - [ERR_DSS_RECV_MSG_FAILED] = "Recv msg failed, errcode:%d, inst:%u.", - [ERR_DSS_INIT_LOGGER_FAILED] = "Log init failed.", - [ERR_DSS_OUT_OF_MEM] = "Failed to apply for memory.", - [ERR_DSS_INVALID_ID] = "Invalid %s id : %llu.", - [ERR_DSS_PROCESS_REMOTE] = "Failed to process remote, errcode: %d, errmsg: %s.", - [ERR_DSS_CONNECT_FAILED] = "Failed to connect dss server, errcode: %d, errmsg: %s.", - [ERR_DSS_VERSION_NOT_MATCH] = - "[CHECK_PROTO]Protocol version need be changed, old protocol version is %u, new protocol version is %u.", - [ERR_DSS_INVALID_BLOCK_TYPE] = "Get Invalid block type, expect type is %u, but the type in share memory is %u.", - [ERR_DSS_SERVER_REBOOT] = "DSS server has reboot or close, dss client need reboot or close.", - [ERR_DSS_UNSUPPORTED_CMD] = "Command \"%s\" is not supported in current version of dssserver.", - [ERR_DSS_VOLUME_FENCE_CHECK_COND] = "Fail to check fence cond:%s.", - [ERR_DSS_HP_NOT_INIT] = "Hotpatch module is not inited.", - [ERR_DSS_HP_LIB_HAS_LOADED] = "The patch has been loaded, don't load it again.", - [ERR_DSS_HP_LIB_NOT_LOADED] = "The patch has not been loaded, please check patch info.", - [ERR_DSS_HP_LIB_IS_ACTIVED] = "The patch has been actived, please check patch info.", - [ERR_DSS_HP_LIB_IS_DEACTIVED] = "The patch has beed deactived, please check patch info.", - [ERR_DSS_HP_LIB_CRC_FAILED] = "Failed to check the CRC of patch file with bin.", - [ERR_DSS_HP_LIB_ERROR] = "Error hotpatch lib, please check run log.", - [ERR_DSS_HP_CANNOT_LOAD] = "Cannot load the patch, please check patch status.", - [ERR_DSS_HP_CANNOT_ACTIVE] = "Cannot active the patch, please check patch status.", - [ERR_DSS_HP_CANNOT_DEACTIVE] = "Cannot deactive the patch, please check patch status.", - [ERR_DSS_HP_CANNOT_UNLOAD] = "Cannot unload the patch, please check patch status.", - [ERR_DSS_HP_PATCH_NUMBER] = "The number of patch has reached its maximum %u.", - [ERR_DSS_HP_CHECKSUM_FAILED] = "Checksum failed when read patch.info file.", - [ERR_DSS_HP_NOT_SUPPORT] = "Hotpatch is not supported in current version.", - [ERR_DSS_HP_LIB_PATCH_CORRUPTED] = "Failed to check patch file CRC, the patch file is corrupted.", - [ERR_DSS_HP_LIB_PATCH_PERMISSION] = "Invalid permission of patch file %s, X00 is expected.", - [ERR_DSS_HP_VERSION_DISMATCH] = "Dismatch between patch info version(%s) and dssserver version(%s).", - [ERR_DSS_HP_PATCH_INFO_LOST] = "Patch info of number %d is lost in patch.info file.", - [ERR_DSS_MASTER_CHANGE] = "Master id has changed.", - [ERR_DSS_RECOVER_CAUSE_BREAK] = "Req break by recovery.", -}; - dss_log_def_t g_dss_cmd_log[] = { {LOG_DEBUG, "debug/dsscmd.dlog"}, {LOG_OPER, "oper/dsscmd.olog"}, diff --git a/src/log/dss_log.h b/src/log/dss_log.h index e6fc638..fb33f25 100644 --- a/src/log/dss_log.h +++ b/src/log/dss_log.h @@ -116,21 +116,6 @@ static inline void dss_print_detail_error() LOG_DEBUG_INF(fmt, ##__VA_ARGS__); \ } while (0) -#define DSS_THROW_ERROR(error_no, ...) \ - do { \ - if (g_dss_error_desc[error_no] != NULL) \ - cm_set_error((char *)__FILE_NAME__, (uint32)__LINE__, (cm_errno_t)error_no, g_dss_error_desc[error_no], \ - ##__VA_ARGS__); \ - else \ - cm_set_error( \ - (char *)__FILE_NAME__, (uint32)__LINE__, (cm_errno_t)error_no, g_error_desc[error_no], ##__VA_ARGS__); \ - } while (0) - -#define DSS_THROW_ERROR_EX(error_no, format, ...) \ - do { \ - cm_set_error((char *)__FILE_NAME__, (uint32)__LINE__, (cm_errno_t)error_no, format, ##__VA_ARGS__); \ - } while (0) - /* * warning id is composed of source + module + object + code * source -- DN(10)/CM(11)/OM(12)/DM(20)/DSS(30) @@ -155,8 +140,6 @@ typedef enum dss_warn_name { typedef enum { DSS_VG_SPACE_ALARM_INIT, DSS_VG_SPACE_ALARM_HWM, DSS_VG_SPACE_ALARM_LWM} dss_alarm_type_e; -#define DSS_ERROR_COUNT 3000 -extern const char *g_dss_error_desc[DSS_ERROR_COUNT]; extern char *g_dss_warn_desc[]; extern uint32 g_dss_warn_id[]; status_t dss_init_loggers(dss_config_t *inst_cfg, dss_log_def_t *log_def, uint32 log_def_count, char *name); -- Gitee