diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2011-11-21 12:35:34 -0500 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-11-28 08:46:31 -0800 |
commit | 1b3571d38fc789100e2c053750eca1109494596b (patch) | |
tree | 407af4eab3a362d07545e174ec7b14b571941783 /xlators/cluster/afr/src/afr.h | |
parent | f52dd9bf2005449f49acd5666a02594fb4c5ac6f (diff) |
Add command-line support (but no doc) for enforce-quorum option.
Change-Id: Ia52ddb551e24c27969f7f5fa0f94c1044789731f
BUG: 3823
Reviewed-on: http://review.gluster.com/743
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
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__ */ |