summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-04-13 07:23:59 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-13 20:11:13 +0530
commitd8bc2834d056a23f55bd86a5fd704bd81e35836d (patch)
tree8c87e75431ab566c02a36fa58d407dab724e5e2f /xlators/cluster
parent8e0d48cbb23cf056277ebc609d47b5184b95fa87 (diff)
Send statbuf from the same subvolume, even across revalidates.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index 8c3bdc06ad8..215a80b21bd 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -628,6 +628,8 @@ afr_lookup (call_frame_t *frame, xlator_t *this,
int ret = -1;
int i = 0;
+ uint64_t ctx;
+
int32_t op_errno = 0;
priv = this->private;
@@ -640,12 +642,19 @@ afr_lookup (call_frame_t *frame, xlator_t *this,
loc_copy (&local->loc, loc);
- LOCK (&priv->read_child_lock);
- {
- local->read_child_index = (++priv->read_child_rr)
- % (priv->child_count);
+ ret = inode_ctx_get (loc->inode, this, &ctx);
+ if (ret == 0) {
+ /* lookup is a revalidate */
+
+ local->read_child_index = afr_read_child (this, loc->inode);
+ } else {
+ LOCK (&priv->read_child_lock);
+ {
+ local->read_child_index = (++priv->read_child_rr)
+ % (priv->child_count);
+ }
+ UNLOCK (&priv->read_child_lock);
}
- UNLOCK (&priv->read_child_lock);
local->call_count = priv->child_count;