From 415e0bcc80b350fc75f325b490560f44ba419b20 Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Tue, 12 Dec 2017 22:31:53 +0100 Subject: all: Simplify component message id's definition This patch creates a new way of defining message id's that is easier and less error prone because it doesn't require so many manual changes each time a new component is defined or a new message created. Change-Id: I71ba8af9ac068f5add7e74f316a2478bc991c67b Signed-off-by: Xavier Hernandez --- .../decompounder/src/decompounder-messages.h | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'xlators/performance/decompounder') diff --git a/xlators/performance/decompounder/src/decompounder-messages.h b/xlators/performance/decompounder/src/decompounder-messages.h index 825599e9479..5f0aab4d92f 100644 --- a/xlators/performance/decompounder/src/decompounder-messages.h +++ b/xlators/performance/decompounder/src/decompounder-messages.h @@ -13,15 +13,19 @@ #include "glfs-message-id.h" -#define GLFS_COMP_BASE_DC GLFS_MSGID_COMP_DC -#define GLFS_NUM_MESSAGES 2 -#define GLFS_MSGID_END (GLFS_COMP_BASE_DC + GLFS_NUM_MESSAGES + 1) +/* To add new message IDs, append new identifiers at the end of the list. + * + * Never remove a message ID. If it's not used anymore, you can rename it or + * leave it as it is, but not delete it. This is to prevent reutilization of + * IDs by other messages. + * + * The component name must match one of the entries defined in + * glfs-message-id.h. + */ + +GLFS_MSGID(DC, + DC_MSG_VOL_MISCONFIGURED, + DC_MSG_ERROR_RECEIVED +); -#define glfs_msg_start_x GLFS_COMP_BASE_DC, "Invalid: Start of messages" - -#define DC_MSG_VOL_MISCONFIGURED (GLFS_COMP_BASE_DC + 1) - -#define DC_MSG_ERROR_RECEIVED (GLFS_COMP_BASE_DC + 2) - -#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages" #endif /* !_DC_MESSAGES_H_ */ -- cgit