diff options
-rw-r--r-- | xlators/cluster/ec/src/ec-method.h | 3 | ||||
-rw-r--r-- | xlators/cluster/ec/src/ec.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/xlators/cluster/ec/src/ec-method.h b/xlators/cluster/ec/src/ec-method.h index 085de8f4b17..29b46e10443 100644 --- a/xlators/cluster/ec/src/ec-method.h +++ b/xlators/cluster/ec/src/ec-method.h @@ -13,7 +13,10 @@ #include "ec-gf.h" +/* Determines the maximum size of the matrix used to encode/decode data */ #define EC_METHOD_MAX_FRAGMENTS 16 +/* Determines the maximum number of usable elements in the Galois Field */ +#define EC_METHOD_MAX_NODES (EC_GF_SIZE - 1) #define EC_METHOD_WORD_SIZE 64 diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index c702ce3f0fd..c6d3b9fe718 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -23,7 +23,7 @@ * using the rule that redundancy cannot be equal or greater than the number * of fragments. */ -#define EC_MAX_NODES (EC_MAX_FRAGMENTS + ((EC_MAX_FRAGMENTS - 1) / 2)) +#define EC_MAX_NODES min(EC_MAX_FRAGMENTS * 2 - 1, EC_METHOD_MAX_NODES) int32_t ec_parse_options(xlator_t * this) { |