summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-05-26 05:02:27 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-05-26 03:39:47 -0700
commitb84ab58d8c849347fc6a337a4e897c365c0b08ae (patch)
tree92a038e8211b254bd2e533c0db985e77656ef1bf /xlators/cluster/afr/src
parent696428efb6195374bfd07c1b483871e1fdb68a55 (diff)
Do itransform in AFR readdir.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index d5e181a5dd3..f74deab6df3 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -157,12 +157,15 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie,
int unwind = 1;
int last_tried = -1;
int this_try = -1;
+ int child_index = -1;
priv = this->private;
children = priv->children;
local = frame->local;
+ child_index = (long) cookie;
+
if (op_ret == -1) {
last_tried = local->cont.readdir.last_tried;
@@ -182,6 +185,9 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie,
out:
if (unwind) {
+ buf->d_ino = afr_itransform (buf->d_ino, priv->child_count,
+ child_index);
+
AFR_STACK_UNWIND (frame, op_ret, op_errno, buf);
}
@@ -233,9 +239,10 @@ afr_readdir (call_frame_t *frame, xlator_t *this,
local->cont.readdir.size = size;
local->cont.readdir.offset = offset;
- STACK_WIND (frame, afr_readdir_cbk,
- children[call_child], children[call_child]->fops->readdir,
- fd, size, offset);
+ STACK_WIND_COOKIE (frame, afr_readdir_cbk, (void *) (long) call_child,
+ children[call_child],
+ children[call_child]->fops->readdir,
+ fd, size, offset);
op_ret = 0;
out: