summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-common.c9
-rw-r--r--xlators/cluster/ec/src/ec.c9
-rw-r--r--xlators/cluster/ec/src/ec.h1
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c5
4 files changed, 21 insertions, 3 deletions
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
index c371eb6687e..68422f8a728 100644
--- a/xlators/cluster/ec/src/ec-common.c
+++ b/xlators/cluster/ec/src/ec-common.c
@@ -2034,11 +2034,13 @@ void ec_flush_size_version(ec_fop_data_t * fop)
void ec_lock_reuse(ec_fop_data_t *fop)
{
ec_cbk_data_t *cbk;
+ ec_t *ec = NULL;
int32_t i, count;
gf_boolean_t release = _gf_false;
-
+ ec = fop->xl->private;
cbk = fop->answer;
- if (cbk != NULL) {
+
+ if (ec->eager_lock && cbk != NULL) {
if (cbk->xdata != NULL) {
if ((dict_get_int32(cbk->xdata, GLUSTERFS_INODELK_COUNT,
&count) == 0) && (count > 1)) {
@@ -2050,7 +2052,8 @@ void ec_lock_reuse(ec_fop_data_t *fop)
}
}
} else {
- /* If we haven't get an answer with enough quorum, we always release
+ /* If eager lock is disabled or If we haven't get
+ * an answer with enough quorum, we always release
* the lock. */
release = _gf_true;
}
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index 1f15af10dab..1d53981303a 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -261,6 +261,8 @@ reconfigure (xlator_t *this, dict_t *options)
failed);
GF_OPTION_RECONF ("iam-self-heal-daemon", ec->shd.iamshd, options,
bool, failed);
+ GF_OPTION_RECONF ("eager-lock", ec->eager_lock, options,
+ bool, failed);
GF_OPTION_RECONF ("background-heals", background_heals, options,
uint32, failed);
GF_OPTION_RECONF ("heal-wait-qlength", heal_wait_qlen, options,
@@ -601,6 +603,7 @@ init (xlator_t *this)
ec_method_initialize();
GF_OPTION_INIT ("self-heal-daemon", ec->shd.enabled, bool, failed);
GF_OPTION_INIT ("iam-self-heal-daemon", ec->shd.iamshd, bool, failed);
+ GF_OPTION_INIT ("eager-lock", ec->eager_lock, bool, failed);
GF_OPTION_INIT ("background-heals", ec->background_heals, uint32, failed);
GF_OPTION_INIT ("heal-wait-qlength", ec->heal_wait_qlen, uint32, failed);
ec_configure_background_heal_opts (ec, ec->background_heals,
@@ -1321,6 +1324,12 @@ struct volume_options options[] =
"translator is running as part of self-heal-daemon "
"or not."
},
+ { .key = {"eager-lock"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "on",
+ .description = "This option will enable/diable eager lock for"
+ "disperse volume "
+ },
{ .key = {"background-heals"},
.type = GF_OPTION_TYPE_INT,
.min = 0,/*Disabling background heals*/
diff --git a/xlators/cluster/ec/src/ec.h b/xlators/cluster/ec/src/ec.h
index 480125e35d3..49af5c2daf2 100644
--- a/xlators/cluster/ec/src/ec.h
+++ b/xlators/cluster/ec/src/ec.h
@@ -54,6 +54,7 @@ struct _ec
gf_lock_t lock;
gf_timer_t * timer;
gf_boolean_t shutdown;
+ gf_boolean_t eager_lock;
uint32_t background_heals;
uint32_t heal_wait_qlen;
struct list_head pending_fops;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 32d95f01e12..523fa3978e7 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -1075,6 +1075,11 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.op_version = 1,
.flags = OPT_FLAG_CLIENT_OPT
},
+ { .key = "disperse.eager-lock",
+ .voltype = "cluster/disperse",
+ .op_version = GD_OP_VERSION_3_7_10,
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
{ .key = "cluster.quorum-type",
.voltype = "cluster/replicate",
.option = "quorum-type",