summaryrefslogtreecommitdiffstats
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:46:05 -0700
commit01b9e590559ea810fb271e91127b3de7fc26816a (patch)
tree0632ad917bf4a2cdb5093760fb9057789eb528af
parentc1c18df3936b01ec4ea8b48b936c4087648f4b3b (diff)
Do itransform in AFR readdir.v2.0.2
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
-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: