summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authoranand <anekkunt@redhat.com>2015-04-28 22:42:14 +0530
committerKaushal M <kaushal@redhat.com>2015-05-04 05:42:06 -0700
commit2aceadae902e6f45e02afa62ee7831479d23b4a5 (patch)
tree3d5aa0e97261eef0c39569df5931b4a4e87aa853 /xlators
parent6a898e9e294bc4c254bb2c29e0514dbe5a81226c (diff)
glusterd: Enable readdir-ahead by default on new volumes
With gluster-3.7, 'performance.readdir-ahead' will be enabled by default on new volumes when the cluster op-version supports it. Change-Id: I44e76a69e7d1c11e6dfad72c941caf887bb810ee BUG: 1216187 Signed-off-by: anand <anekkunt@redhat.com> Reviewed-on: http://review.gluster.org/10433 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 31aabaf41d0..0f80354cdcc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -9091,7 +9091,7 @@ glusterd_enable_default_options (glusterd_volinfo_t *volinfo, char *option)
conf = this->private;
GF_ASSERT (conf);
- if (conf->op_version >= GD_OP_VERSION_3_6_0) {
+ if (conf->op_version >= GD_OP_VERSION_3_7_0) {
/* Set needed volume options in volinfo->dict
* For ex.,
*
@@ -9100,6 +9100,22 @@ glusterd_enable_default_options (glusterd_volinfo_t *volinfo, char *option)
* ...
* }
* */
+
+ /* readdir-ahead needs to be enabled for new volumes with
+ * >= gluster version 3.7
+ */
+ if (!option || !strcmp ("performance.readdir-ahead", option)) {
+ ret = dict_set_dynstr_with_alloc (volinfo->dict,
+ "performance.readdir-ahead", "on");
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Failed to set option "
+ "'performance.readdir-ahead' on volume "
+ "%s", volinfo->volname);
+ goto out;
+ }
+ }
+
}
out:
return ret;