summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2016-05-12 16:40:04 -0400
committerRaghavendra Bhat <raghavendra@redhat.com>2017-04-18 23:29:46 -0400
commite3d9018f2ddc28548c0aa18960a3a524521c9ad7 (patch)
tree75021b8f2456708d2d902e4c6e7ea54958173d64 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent10dad995c989e9d77c341135d7c48817baba966c (diff)
features/bit-rot-stub: bring in optional versioning
* As of now bit-rot-stub does versioning always. This leads lots of getxattr calls being made in lookups. So make object versioning optional. Change-Id: I83713e45ae59fb28004bb3cfa008f2d69edebbfa BUG: 1359599 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: https://review.gluster.org/14442 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> 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, 15 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 2577ad81fc7..77b7d55fa29 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1603,8 +1603,10 @@ static int
brick_graph_add_bitrot_stub (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
{
- xlator_t *xl = NULL;
- int ret = -1;
+ xlator_t *xl = NULL;
+ int ret = -1;
+ char *value = NULL;
+ xlator_t *this = THIS;
if (!graph || !volinfo || !set_dict || !brickinfo)
goto out;
@@ -1614,6 +1616,17 @@ brick_graph_add_bitrot_stub (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
goto out;
ret = xlator_set_option (xl, "export", brickinfo->path);
+ if (ret) {
+ gf_log (this->name, GF_LOG_WARNING, "failed to set the export "
+ "option in bit-rot-stub");
+ goto out;
+ }
+
+ ret = glusterd_volinfo_get (volinfo, VKEY_FEATURES_BITROT, &value);
+ ret = xlator_set_option (xl, "bitrot", value);
+ if (ret)
+ gf_log (this->name, GF_LOG_WARNING, "failed to set bitrot "
+ "enable option in bit-rot-stub");
out:
return ret;