From 326a7d04260c15f1b6e201621438844f8747b963 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 21 Feb 2012 22:06:29 +0530 Subject: cluster/afr: Add new option to know which process it is in Afr xl needs to maintain inode-table inside the xl if it is in self-heal-daemon. The code was depending on the option self-heal-daemon to do this. This is wrong as the option can be reconfigured to on/off. Added a new option which can't be reconfigured for this purpose. Change-Id: Idc42c403c4bd9b73d1f328427ae4158ff1420b3a BUG: 795741 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/2787 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 84222136c81..5fbef4e445e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -2465,7 +2465,7 @@ build_client_graph (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, static int shd_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, - void *param) + void *param) { int ret = 0; struct volopt_map_entry new_vme = {0}; @@ -2659,6 +2659,23 @@ nfs_option_handler (volgen_graph_t *graph, return 0; } +static int +volgen_graph_set_iam_shd (volgen_graph_t *graph) +{ + xlator_t *trav; + int ret = 0; + + for (trav = first_of (graph); trav; trav = trav->next) { + if (strcmp (trav->type, "cluster/replicate") != 0) + continue; + + ret = xlator_set_option (trav, "iam-self-heal-daemon", "yes"); + if (ret) + break; + } + return ret; +} + static int build_shd_graph (volgen_graph_t *graph, dict_t *mod_dict) { @@ -2733,6 +2750,10 @@ build_shd_graph (volgen_graph_t *graph, dict_t *mod_dict) if (ret) goto out; + ret = volgen_graph_set_iam_shd (&cgraph); + if (ret) + goto out; + ret = volgen_graph_merge_sub (graph, &cgraph, rclusters); if (ret) goto out; -- cgit