summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2013-07-24 18:34:38 +0530
committerVijay Bellur <vbellur@redhat.com>2013-08-02 02:28:46 -0700
commit3af61d6758bc41e7c461d9d54f0caf872870329c (patch)
treecad20969f32590404caad71fc6a31fefb8ac5244 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent36b102645ab66d141dcc831e67caa78966d45419 (diff)
glusterd: Use volume op-versions during volgen
Instead of using the cluster op-version, volume op-version is used to enable open-behind during volgen. For doing this, the volume op-versions are updated before regenerating the volfiles. Change-Id: I675bb549bf7c7c0279030dca698fb530781addc6 BUG: 990830 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/5385 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> 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.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 127e4c4631d..d849f31b1e4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1696,16 +1696,11 @@ static int
perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
void *param)
{
- 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;
+ glusterd_volinfo_t *volinfo = NULL;
- volname = param;
+ GF_ASSERT (param);
+ volinfo = param;
if (strcmp (vme->option, "!perf") != 0)
return 0;
@@ -1718,10 +1713,10 @@ perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme,
/* 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))
+ (vme->op_version > volinfo->client_op_version))
return 0;
- if (volgen_graph_add (graph, vme->voltype, volname))
+ if (volgen_graph_add (graph, vme->voltype, volinfo->volname))
return 0;
else
return -1;
@@ -2472,7 +2467,7 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
default for a volume */
tmp_data = dict_get (set_dict, "nfs-volume-file");
if (!tmp_data)
- ret = volgen_graph_set_options_generic (graph, set_dict, volname,
+ ret = volgen_graph_set_options_generic (graph, set_dict, volinfo,
&perfxl_option_handler);
else
ret = volgen_graph_set_options_generic (graph, set_dict, volname,