summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-08-22 14:08:43 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-22 22:27:40 -0700
commit63f9e2a49573a0b539c0082fd0c08c1b4d4db983 (patch)
treed697fb49e1a713bf1d83f4d8275857b0f0f1faa4 /xlators/cluster/afr/src/afr.c
parent37ec7db018979d04d02ae5670b53dbed7a498ba8 (diff)
cluster/afr: Use 2 phase locking for transactions and self heal.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 960 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=960
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 629e1875e..9d06cd034 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -93,6 +93,8 @@ init (xlator_t *this)
char * algo = NULL;
char * change_log = NULL;
char * strict_readdir = NULL;
+ char * inodelk_trace = NULL;
+ char * entrylk_trace = NULL;
int32_t background_count = 0;
int32_t lock_server_count = 1;
@@ -250,6 +252,37 @@ init (xlator_t *this)
/* Locking options */
+ priv->inodelk_trace = 0;
+ priv->entrylk_trace = 0;
+
+ dict_ret = dict_get_str (this->options, "inodelk-trace",
+ &inodelk_trace);
+ if (dict_ret == 0) {
+ ret = gf_string2boolean (inodelk_trace, &priv->inodelk_trace);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Invalid 'option inodelk-trace %s' ",
+ inodelk_trace);
+
+ priv->inodelk_trace = 0;
+ }
+ }
+
+
+ dict_ret = dict_get_str (this->options, "entrylk-trace",
+ &entrylk_trace);
+ if (dict_ret == 0) {
+ ret = gf_string2boolean (entrylk_trace, &priv->entrylk_trace);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "Invalid 'option entrylk-trace %s' ",
+ inodelk_trace);
+
+ priv->entrylk_trace = 0;
+ }
+ }
+
+
priv->data_lock_server_count = 1;
priv->metadata_lock_server_count = 0;
priv->entry_lock_server_count = 1;