From ae097b8ad5c160aed43d82187b623f053adf11b4 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Fri, 5 Apr 2019 08:59:35 +0300 Subject: glusterd-volgen.c: skip fetching skip-CLIOT in a loop. Its value is not going to change within the loop, as far as I can understand the code. Fetch and store it outside the loop. Change-Id: I6327c23212dceec6006349421ef185495892dd8a updates: bz#1193929 Signed-off-by: Yaniv Kaul --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 621ca49ebe6..08b80fcf142 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -506,6 +506,7 @@ volgen_graph_set_options_generic(volgen_graph_t *graph, dict_t *dict, 0, }; data_t *data = NULL; + const int skip_cliot = dict_get_str_boolean(dict, "skip-CLIOT", _gf_false); odt.graph = graph; odt.handler = handler; @@ -518,8 +519,8 @@ volgen_graph_set_options_generic(volgen_graph_t *graph, dict_t *dict, odt.data_t_fake = _gf_false; data = dict_get(dict, vme->key); - if (!strcmp(vme->key, "performance.client-io-threads") && - dict_get_str_boolean(dict, "skip-CLIOT", _gf_false) == _gf_true) { + if (skip_cliot == _gf_true && + !strcmp(vme->key, "performance.client-io-threads")) { continue; } -- cgit