summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht.c
diff options
context:
space:
mode:
authorshishir gowda <sgowda@redhat.com>2012-08-13 11:20:17 +0530
committerVijay Bellur <vbellur@redhat.com>2012-08-16 22:25:17 -0700
commit502c95bdfb35640fb424b37b080664e9c1639a86 (patch)
tree0f3f2224e3bbd51b3cacd08cc7ef4f3712c9eeaa /xlators/cluster/dht/src/dht.c
parent28328417bff73b13392e95a07c3d359c881bebc8 (diff)
cluster/dht: Optimize readdirp calls in DHT
Bring in option which is supported by posix xlator to filter out directory's entries from being returned. DHT would now request non-first subvols to filter out directory entries. dht xlator-option readdir-optimize will enable this optimization Change-Id: Ibf99f1bef501f285ff44a1cecfbebee9e16063b6 BUG: 838199 Signed-off-by: shishir gowda <sgowda@redhat.com> Reviewed-on: http://review.gluster.com/3806 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht.c')
-rw-r--r--xlators/cluster/dht/src/dht.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index e3930e2af3f..68a8efcde88 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -331,7 +331,8 @@ reconfigure (xlator_t *this, dict_t *options)
percent, out);
GF_OPTION_RECONF ("directory-layout-spread", conf->dir_spread_cnt,
options, uint32, out);
-
+ GF_OPTION_RECONF ("readdir-optimize", conf->readdir_optimize, options,
+ bool, out);
if (dict_get_str (options, "decommissioned-bricks", &temp_str) == 0) {
ret = dht_parse_decommissioned_bricks (this, conf, temp_str);
if (ret == -1)
@@ -431,6 +432,7 @@ init (xlator_t *this)
GF_OPTION_INIT ("assert-no-child-down", conf->assert_no_child_down,
bool, err);
+ GF_OPTION_INIT ("readdir-optimize", conf->readdir_optimize, bool, err);
ret = dht_init_subvolumes (this, conf);
if (ret == -1) {
@@ -593,6 +595,10 @@ struct volume_options options[] = {
{ .key = {"node-uuid"},
.type = GF_OPTION_TYPE_STR,
},
+ { .key = {"readdir-optimize"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "off",
+ },
{ .key = {NULL} },
};