From 1bfb0a750c6fcd0bbf4d68a1890704f0aefe6337 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sun, 17 Nov 2019 11:00:50 +0530 Subject: 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 --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index b93c7b84c90..f872c207b66 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; -- cgit