summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-dir-read.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr-dir-read.c')
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index 4205c157d..f1638c740 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -156,9 +156,6 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie,
gf_dirent_t * entry = NULL;
- int unwind = 1;
- int last_tried = -1;
- int this_try = -1;
int child_index = -1;
priv = this->private;
@@ -168,33 +165,15 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie,
child_index = (long) cookie;
- if (op_ret == -1) {
- last_tried = local->cont.readdir.last_tried;
-
- if (all_tried (last_tried, priv->child_count)) {
- goto out;
- }
-
- this_try = ++local->cont.readdir.last_tried;
- unwind = 0;
-
- STACK_WIND (frame, afr_readdir_cbk,
- children[this_try],
- children[this_try]->fops->readdir,
- local->fd, local->cont.readdir.size,
- local->cont.readdir.offset);
- }
-
-out:
- if (unwind) {
+ if (op_ret != -1) {
list_for_each_entry (entry, &entries->list, list) {
entry->d_ino = afr_itransform (entry->d_ino,
priv->child_count,
child_index);
}
-
- AFR_STACK_UNWIND (frame, op_ret, op_errno, entries);
- }
+ }
+
+ AFR_STACK_UNWIND (frame, op_ret, op_errno, entries);
return 0;
}
@@ -238,8 +217,6 @@ afr_readdir (call_frame_t *frame, xlator_t *this,
goto out;
}
- local->cont.readdir.last_tried = call_child;
-
local->fd = fd_ref (fd);
local->cont.readdir.size = size;
local->cont.readdir.offset = offset;