summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-05-13 12:53:25 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-13 12:12:19 -0700
commitbb315cb180c3547218b5ed581d38e76aec74cf94 (patch)
tree206f21cf5c68e0d37cc492a42d5eaa6d710387b0 /xlators/cluster/dht
parent97e060d04b6b86225264644ff8fef0459577a031 (diff)
fuse, dht: use readdir by default.
dht - switch over to readdirp based algo if one subvolume is down Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 898 (small file performance enhancements) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=898
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index f0bac240b0c..1cfeae690f9 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2201,7 +2201,7 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
subvol = dht_layout_search (this, layout, orig_entry->d_name);
- if (!subvol || (subvol != prev->this)) {
+ if (!subvol || (subvol == prev->this)) {
entry = gf_dirent_for_name (orig_entry->d_name);
if (!entry) {
gf_log (this->name, GF_LOG_ERROR,
@@ -2317,7 +2317,20 @@ int
dht_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
off_t yoff)
{
- dht_do_readdir (frame, this, fd, size, yoff, GF_FOP_READDIR);
+ int op = GF_FOP_READDIR;
+ dht_conf_t *conf = NULL;
+ int i = 0;
+
+ conf = this->private;
+
+ for (i = 0; i < conf->subvolume_cnt; i++) {
+ if (!conf->subvolume_status[i]) {
+ op = GF_FOP_READDIRP;
+ break;
+ }
+ }
+
+ dht_do_readdir (frame, this, fd, size, yoff, op);
return 0;
}