From 22f47322d246c94d0bec8e893e4837a67d39f544 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Mon, 3 Mar 2014 18:00:59 +0530 Subject: Barrier: Barrier translator options configuration barrier enable/disable, barrier-timeout configuration in barrier translator. Change-Id: I7cbf9cd4f5e55d42dcc6b7cd6827234566c7b6f3 BUG: 1060002 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/7177 Reviewed-by: Kaushal M Tested-by: Gluster Build System --- xlators/features/barrier/src/barrier.c | 6 +++--- xlators/mgmt/glusterd/src/glusterd-volgen.c | 4 ++++ xlators/mgmt/glusterd/src/glusterd-volume-set.c | 10 ++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/xlators/features/barrier/src/barrier.c b/xlators/features/barrier/src/barrier.c index 9937698ed..5edb9cdd3 100644 --- a/xlators/features/barrier/src/barrier.c +++ b/xlators/features/barrier/src/barrier.c @@ -415,7 +415,7 @@ reconfigure (xlator_t *this, dict_t *options) GF_ASSERT (priv); GF_OPTION_RECONF ("barrier", barrier_enabled, options, bool, out); - GF_OPTION_RECONF ("timeout", timeout, options, time, out); + GF_OPTION_RECONF ("barrier-timeout", timeout, options, time, out); INIT_LIST_HEAD (&queue); @@ -490,7 +490,7 @@ init (xlator_t *this) LOCK_INIT (&priv->lock); GF_OPTION_INIT ("barrier", priv->barrier_enabled, bool, out); - GF_OPTION_INIT ("timeout", timeout, time, out); + GF_OPTION_INIT ("barrier-timeout", timeout, time, out); priv->timeout.tv_sec = timeout; INIT_LIST_HEAD (&priv->queue); @@ -646,7 +646,7 @@ struct volume_options options[] = { "write (with O_SYNC), fsync. It is turned \"off\" by " "default." }, - { .key = {"timeout"}, + { .key = {"barrier-timeout"}, .type = GF_OPTION_TYPE_TIME, .default_value = "120", .description = "After 'timeout' seconds since the time 'barrier' " diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 316b70f77..797370a87 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -1589,6 +1589,10 @@ server_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, if (ret) return -1; + xl = volgen_graph_add (graph, "features/barrier", volname); + if (!xl) + return -1; + ret = dict_get_int32 (volinfo->dict, "enable-pump", &pump); if (ret == -ENOENT) ret = pump = 0; diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 1c5d359d9..e3af4e7f5 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -1524,6 +1524,16 @@ struct volopt_map_entry glusterd_volopt_map[] = { .type = NO_DOC, .op_version = 3 }, + { .key = "features.barrier", + .voltype = "features/barrier", + .value = "disable", + .op_version = 4 + }, + { .key = "features.barrier-timeout", + .voltype = "features/barrier", + .value = "120", + .op_version = 4 + }, { .key = NULL } }; -- cgit