summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorPrashanth Pai <ppai@redhat.com>2014-02-17 20:42:42 +0530
committerVijay Bellur <vbellur@redhat.com>2014-02-26 09:18:35 -0800
commitf69e85511645fcbd0526e38ca88dd3e5bf0ed917 (patch)
tree88d9b3355bd9eb147a62e059dd62a5951762f101 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent64079f83528edb4cc4ae1a85a8633fd578b6e393 (diff)
feature/compress: Validate option and enable doc
* Validate network.compression option * Enable descriptions of xlator configurable options * Improve indentation in code * Make network.compression.mode not configurable by user. This is similar to "iam-self-heal-daemon" option in AFR xlator. Fixes BUGs: 1065658, 1065640, 1065655 Change-Id: I99d82b574ee0e5c8c2baf5f5d52dbf8d015d330a BUG: 1065640 Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/7024 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.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 7cb858b01..001825941 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1666,13 +1666,16 @@ server_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
}
/* Check for compress volume option, and add it to the graph on server side */
- if (dict_get_str_boolean (set_dict, "network.compression", 0)) {
+ ret = dict_get_str_boolean (set_dict, "network.compression", 0);
+ if (ret == -1)
+ goto out;
+ if (ret) {
xl = volgen_graph_add (graph, "features/cdc", volname);
if (!xl) {
ret = -1;
goto out;
}
- ret = dict_set_str (set_dict, "network.compression.mode", "server");
+ ret = xlator_set_option (xl, "mode", "server");
if (ret)
goto out;
}
@@ -2543,16 +2546,18 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
goto out;
/* Check for compress volume option, and add it to the graph on client side */
- if (dict_get_str_boolean (set_dict, "network.compression", 0)) {
+ ret = dict_get_str_boolean (set_dict, "network.compression", 0);
+ if (ret == -1)
+ goto out;
+ if (ret) {
xl = volgen_graph_add (graph, "features/cdc", volname);
if (!xl) {
ret = -1;
goto out;
}
- ret = dict_set_str (set_dict, "network.compression.mode", "client");
+ ret = xlator_set_option (xl, "mode", "client");
if (ret)
goto out;
-
}
ret = glusterd_volinfo_get_boolean (volinfo, "features.encryption");