diff options
author | Poornima G <pgurusid@redhat.com> | 2016-12-08 16:08:40 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-01-24 00:07:42 -0500 |
commit | 7c6538f6c8f9a015663b4fc57c640a7c451c87f7 (patch) | |
tree | 252b6d9da6bc34ee17a0635502d15cb67987758a /xlators/cluster/dht | |
parent | f2e7b6800b812e8bbc9bdbcea4c400a1784e31dc (diff) |
Readdir-ahead : Honor readdir-optimise option of dht
Change-Id: I9c5e65b32e316e6a2fc7e1f5c79fce79386b78e2
BUG: 1401812
Signed-off-by: Poornima G <pgurusid@redhat.com>
Reviewed-on: https://review.gluster.org/16071
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 27a7eef7c10..31bea00d203 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -4860,6 +4860,7 @@ dht_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, dht_conf_t *conf = NULL; int op_errno = -1; int i = -1; + int ret = 0; VALIDATE_OR_GOTO (frame, err); VALIDATE_OR_GOTO (this, err); @@ -4891,6 +4892,18 @@ dht_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd, } else { local->call_cnt = conf->local_subvols_cnt; for (i = 0; i < conf->local_subvols_cnt; i++) { + if (conf->readdir_optimize == _gf_true) { + if (conf->local_subvols[i] != local->first_up_subvol) + ret = dict_set_int32 (local->xattr, + GF_READDIR_SKIP_DIRS, 1); + if (ret) + gf_msg (this->name, GF_LOG_ERROR, 0, + DHT_MSG_DICT_SET_FAILED, + "Failed to set dictionary" + " value :key = %s, ret:%d", + GF_READDIR_SKIP_DIRS, ret); + + } STACK_WIND_COOKIE (frame, dht_fd_cbk, conf->local_subvols[i], conf->local_subvols[i], |