summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorAmar Tumballi <amar@kadalu.io>2019-11-17 11:00:50 +0530
committerXavi Hernandez <xhernandez@redhat.com>2019-11-29 07:01:53 +0000
commit1bfb0a750c6fcd0bbf4d68a1890704f0aefe6337 (patch)
tree2e83e49dd2b68a96984f093be8309d23dc1cf8ac /xlators/mgmt/glusterd/src
parent7c1e383876ad15ec6fc93d412311662f42390a11 (diff)
debug/io-stats: add an option to set volume-id
'volume-id' is good to have for a graph for uniquely identifying it. Add it to graph->volume_id while generating volfile itself. This can be further used in many other places. Updates: #763 Change-Id: I80516d62d28a284e8ff4707841570ced97a37e73 Signed-off-by: Amar Tumballi <amar@kadalu.io>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index b93c7b8..f872c20 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -2216,6 +2216,8 @@ brick_graph_add_io_stats(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
{
int ret = -1;
xlator_t *xl = NULL;
+ xlator_t *this = THIS;
+ glusterd_conf_t *priv = this->private;
if (!graph || !set_dict || !brickinfo)
goto out;
@@ -2228,6 +2230,13 @@ brick_graph_add_io_stats(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
if (ret)
goto out;
+ if (priv->op_version >= GD_OP_VERSION_7_1) {
+ ret = xlator_set_fixed_option(xl, "volume-id",
+ uuid_utoa(volinfo->volume_id));
+ if (ret)
+ goto out;
+ }
+
ret = 0;
out:
return ret;