From 7d0cf52a344e476963fe97e71f86488d5bb17b1c Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Fri, 19 Apr 2013 15:16:56 +0530 Subject: glusterd-volgen: Enable open-behind based on op-version 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. Change-Id: Idf7a3c274ec4828aafc815cdd1df829ecb853354 BUG: 954256 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/4866 Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 56ce6b3a1..72bd36d3a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -460,6 +460,8 @@ process_option (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) @@ -1674,6 +1676,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; @@ -1685,6 +1693,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 -- cgit