diff options
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r-- | libglusterfs/src/common-utils.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 8dc5141247e..351eb4daaec 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -46,6 +46,7 @@ #include "globals.h" #include "lkowner.h" #include "syscall.h" +#include "cli1-xdr.h" #include <ifaddrs.h> #include "libglusterfs-messages.h" @@ -53,6 +54,18 @@ #define AI_ADDRCONFIG 0 #endif /* AI_ADDRCONFIG */ +char *vol_type_str[] = {"Distribute", + "Stripe", + "Replicate", + "Striped-Replicate", + "Disperse", + "Tier", + "Distributed-Stripe", + "Distributed-Replicate", + "Distributed-Striped-Replicate", + "Distributed-Disperse", + }; + typedef int32_t (*rw_op_t)(int32_t fd, char *buf, int32_t size); typedef int32_t (*rwv_op_t)(int32_t fd, const struct iovec *buf, int32_t size); @@ -2723,6 +2736,16 @@ out: } int +get_vol_type (int type, int dist_count, int brick_count) +{ + if ((type != GF_CLUSTER_TYPE_TIER) && (type > 0) && + (dist_count < brick_count)) + type = type + GF_CLUSTER_TYPE_MAX - 1; + + return type; +} + +int validate_brick_name (char *brick) { char *delimiter = NULL; |