diff options
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 0566495fe96..4aea44c4275 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -144,9 +144,9 @@ typedef struct _afr_private { pthread_mutex_t mutex; struct list_head saved_fds; /* list of fds on which locks have succeeded */ - gf_boolean_t optimistic_change_log; - gf_boolean_t eager_lock; - gf_boolean_t enforce_quorum; + gf_boolean_t optimistic_change_log; + gf_boolean_t eager_lock; + unsigned int quorum_count; char vol_uuid[UUID_SIZE + 1]; int32_t *last_event; @@ -1006,16 +1006,22 @@ gf_boolean_t afr_have_quorum (char *logname, afr_private_t *priv); /* + * Special value indicating we should use the "auto" quorum method instead of + * a fixed value (including zero to turn off quorum enforcement). + */ +#define AFR_QUORUM_AUTO INT_MAX + +/* * Having this as a macro will make debugging a bit weirder, but does reduce * the probability of functions handling this check inconsistently. */ #define QUORUM_CHECK(_func,_label) do { \ - if (priv->enforce_quorum && !afr_have_quorum(this->name,priv)) { \ - gf_log(this->name,GF_LOG_WARNING, \ - "failing "#_func" due to lack of quorum"); \ - op_errno = EROFS; \ - goto _label; \ - } \ + if (priv->quorum_count && !afr_have_quorum(this->name,priv)) { \ + gf_log(this->name,GF_LOG_WARNING, \ + "failing "#_func" due to lack of quorum"); \ + op_errno = EROFS; \ + goto _label; \ + } \ } while (0); #endif /* __AFR_H__ */ |