a3470f
From 20a92ebcfcf534390468fadca97e7fdc0207967c Mon Sep 17 00:00:00 2001
a3470f
From: Poornima G <pgurusid@redhat.com>
a3470f
Date: Wed, 25 Oct 2017 17:00:36 +0530
a3470f
Subject: [PATCH 131/139] readdir-ahead: Add parallel-readdir option in
a3470f
 readdir-ahead
a3470f
a3470f
parallel-readdir option is defined as belonging to readdir-ahead
a3470f
in glusterd-volume-set.c, but was not defined in options of
a3470f
readdir-ahead, fixing the same.
a3470f
a3470f
> Reviewed on: https://review.gluster.org/#/c/18572/
a3470f
> Change-Id: I97cc88b38ab99ade5f066519ca1cb9bfed03a7da
a3470f
> BUG: 1506197
a3470f
> Signed-off-by: Poornima G <pgurusid@redhat.com>
a3470f
> (cherry picked from commit 80a6a2357c0c0351691c450c40de820efce7ff6f)
a3470f
a3470f
Change-Id: I97cc88b38ab99ade5f066519ca1cb9bfed03a7da
a3470f
BUG: 1463592
a3470f
Signed-off-by: Poornima G <pgurusid@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/128484
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
---
a3470f
 xlators/performance/readdir-ahead/src/readdir-ahead.c | 13 +++++++++++++
a3470f
 xlators/performance/readdir-ahead/src/readdir-ahead.h |  1 +
a3470f
 2 files changed, 14 insertions(+)
a3470f
a3470f
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c
a3470f
index 8827b8b..c2ceda4 100644
a3470f
--- a/xlators/performance/readdir-ahead/src/readdir-ahead.c
a3470f
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c
a3470f
@@ -635,6 +635,8 @@ reconfigure(xlator_t *this, dict_t *options)
a3470f
                          size_uint64, err);
a3470f
         GF_OPTION_RECONF("rda-cache-limit", priv->rda_cache_limit, options,
a3470f
                          size_uint64, err);
a3470f
+        GF_OPTION_RECONF("parallel-readdir", priv->parallel_readdir, options,
a3470f
+                         bool, err);
a3470f
 
a3470f
 	return 0;
a3470f
 err:
a3470f
@@ -678,6 +680,8 @@ init(xlator_t *this)
a3470f
                        err);
a3470f
         GF_OPTION_INIT("rda-cache-limit", priv->rda_cache_limit, size_uint64,
a3470f
                        err);
a3470f
+        GF_OPTION_INIT("parallel-readdir", priv->parallel_readdir, bool,
a3470f
+                       err);
a3470f
 
a3470f
 	return 0;
a3470f
 
a3470f
@@ -745,6 +749,15 @@ struct volume_options options[] = {
a3470f
                          "value, irrespective of the number/size of "
a3470f
                          "directories cached",
a3470f
         },
a3470f
+        { .key = {"parallel-readdir"},
a3470f
+          .type = GF_OPTION_TYPE_BOOL,
a3470f
+          .default_value = "off",
a3470f
+          .description = "If this option is enabled, the readdir operation "
a3470f
+                         "is performed in parallel on all the bricks, thus "
a3470f
+                         "improving the performance of readdir. Note that "
a3470f
+                         "the performance improvement is higher in large "
a3470f
+                         "clusters"
a3470f
+        },
a3470f
         { .key = {NULL} },
a3470f
 };
a3470f
 
a3470f
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.h b/xlators/performance/readdir-ahead/src/readdir-ahead.h
a3470f
index 8c663e0..36d4df8 100644
a3470f
--- a/xlators/performance/readdir-ahead/src/readdir-ahead.h
a3470f
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead.h
a3470f
@@ -45,6 +45,7 @@ struct rda_priv {
a3470f
 	uint64_t rda_high_wmark;
a3470f
         uint64_t rda_cache_limit;
a3470f
         uint64_t rda_cache_size;
a3470f
+        gf_boolean_t parallel_readdir;
a3470f
 };
a3470f
 
a3470f
 #endif /* __READDIR_AHEAD_H */
a3470f
-- 
a3470f
1.8.3.1
a3470f