From aec219826ef265ee287a642e1341ddf4f97fe478 Mon Sep 17 00:00:00 2001 From: nik-redhat Date: Tue, 4 Aug 2020 06:37:00 +0530 Subject: glusterd: automatically turn on dependencies for parallel-readdir Issue: On setting the performance.parallel-readdir to "on" the dependencies of it should automatically be turned on and readdir-ahead should be the parent of each dht subvolume. Fix: On enabling the parallel-readdir, the dependencies are turned on by enabling readdir-ahead simultaneously, and readdir-ahead will be seen as the parent of each dht subvolume. Fixes: #1416 Change-Id: Ic83ae470152b88edddc274d5e6c4d74169d23c15 Signed-off-by: nik-redhat --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 087be916c23..00d9338d2e9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -3359,6 +3359,9 @@ volgen_link_bricks(volgen_graph_t *graph, glusterd_volinfo_t *volinfo, if ((i % sub_count) == 0) { xl = volgen_graph_add_nolink(graph, xl_type, xl_namefmt, volname, j); + if (strncmp(xl_type, "performance/readdir-ahead", + SLEN("performance/readdir-ahead")) == 0) + xlator_set_fixed_option(xl, "performance.readdir-ahead", "on"); j++; } if (!xl) { @@ -3593,13 +3596,13 @@ volgen_graph_build_readdir_ahead(volgen_graph_t *graph, int32_t clusters = 0; if (graph->type == GF_QUOTAD || graph->type == GF_SNAPD || - !glusterd_volinfo_get_boolean(volinfo, VKEY_PARALLEL_READDIR) || - !glusterd_volinfo_get_boolean(volinfo, VKEY_READDIR_AHEAD)) + !glusterd_volinfo_get_boolean(volinfo, VKEY_PARALLEL_READDIR)) goto out; clusters = volgen_link_bricks_from_list_tail( graph, volinfo, "performance/readdir-ahead", "%s-readdir-ahead-%d", child_count, 1); + out: return clusters; } -- cgit