summaryrefslogtreecommitdiffstats
path: root/utils.h
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-01-27 23:28:59 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-01-30 19:31:50 +0530
commitf25b4e7326838c73d0a7a71bd64c8658e44f4219 (patch)
tree0be4325936644bfc7be6cec74761fc4beb305642 /utils.h
parentaa861a01de2f89aec61dddeba13b929222143a52 (diff)
gluster-blockd: consider spare nodes to satisfy the multipath request
In case if number of block hosts are more than the multipath request, consider that spare nodes to satify the request. Lets say we need multipath of 3, but the admin provides 5 block-hosts. If any of the node fail to configure target from first three, then consider configuring fourth node to satify the HA request. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/utils.h b/utils.h
index d4801ae..6a98e67 100644
--- a/utils.h
+++ b/utils.h
@@ -91,7 +91,49 @@
# define GB_FREE(ptr) gbFree(1 ? (void *) &(ptr) : (ptr))
-
+typedef enum Metakey {
+ GBID = 0,
+ SIZE = 1,
+ HA = 2,
+ ENTRYCREATE = 3,
+
+ METAKEY__MAX = 4 /* Updata this when add new Key */
+} Metakey;
+
+static const char *const MetakeyLookup[] = {
+ [GBID] = "GBID",
+ [SIZE] = "SIZE",
+ [HA] = "HA",
+ [ENTRYCREATE] = "ENTRYCREATE",
+ [METAKEY__MAX] = NULL,
+};
+
+typedef enum MetaStatus {
+ CONFIGSUCCESS = 0,
+ CONFIGFAIL = 1,
+ CONFIGINPROGRESS = 2,
+ CLEANUPSUCCESS = 3,
+ CLEANUPFAIL = 4,
+ CLEANUPINPROGRES = 5,
+
+ METASTATUS__MAX = 6 /* Updata this when add new Status type */
+} MetaStatus;
+
+static const char *const MetaStatusLookup[] = {
+ [CONFIGINPROGRESS] = "CONFIGINPROGRESS",
+ [CONFIGSUCCESS] = "CONFIGSUCCESS",
+ [CONFIGFAIL] = "CONFIGFAIL",
+ [CLEANUPINPROGRES] = "CLEANUPINPROGRESS",
+ [CLEANUPSUCCESS] = "CLEANUPSUCCESS",
+ [CLEANUPFAIL] = "CLEANUPFAIL",
+
+ [METASTATUS__MAX] = NULL,
+};
+
+
+int blockMetaKeyEnumParse(const char *opt);
+
+int blockMetaStatusEnumParse(const char *opt);
int gbAlloc(void *ptrptr, size_t size,
const char *filename, const char *funcname, size_t linenr);