summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2013-04-19 15:16:56 +0530
committerVijay Bellur <vbellur@redhat.com>2013-06-05 05:26:55 -0700
commite59bce74ca3f684c82d028a4166f9fb647e58881 (patch)
tree5aa3270d2ee784683ddc86fc3a306535525934b8 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent6cfc9c7f1d447451dc3d4af02a22058b861235eb (diff)
glusterd-volgen: Enable open-behind based on op-version
Backport of patch on master branch, under review at http://review.gluster.org/4866 This patch enables the open-behind by default only when the op-version allows it. Also the volume op-version calculations take account of this enablement. BUG: 954256 Change-Id: Ie739bc23ba90ec2f009feecef28187912a37487c Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/5095 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index ccfa28e35..3d07412b2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -460,6 +460,8 @@ process_option (dict_t *dict, char *key, data_t *value, void *param)
vme.key = key;
vme.voltype = odt->vme->voltype;
vme.option = odt->vme->option;
+ vme.op_version = odt->vme->op_version;
+
if (!vme.option) {
vme.option = strrchr (key, '.');
if (vme.option)
@@ -1673,6 +1675,12 @@ perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
{
char *volname = NULL;
gf_boolean_t enabled = _gf_false;
+ xlator_t *this = NULL;
+ glusterd_conf_t *conf = NULL;
+
+ this = THIS;
+ GF_ASSERT (this);
+ conf = this->private;
volname = param;
@@ -1684,6 +1692,12 @@ perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
if (!enabled)
return 0;
+ /* Check op-version before adding the 'open-behind' xlator in the graph
+ */
+ if (!strcmp (vme->key, "performance.open-behind") &&
+ (vme->op_version > conf->op_version))
+ return 0;
+
if (volgen_graph_add (graph, vme->voltype, volname))
return 0;
else