summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-05-02 03:11:54 +0000
committerAnand Avati <avati@gluster.com>2011-05-03 10:17:04 -0700
commitcadd9a1b75fb1f78d2fb7c578212ee0225cfeb83 (patch)
tree436e49d89934a1a6fcdb7996f31d3356d1e46907 /xlators/cluster/afr/src
parentfd7e3b6052881319d4671771aae44933bbf858d4 (diff)
loc_t: add 'gfid' and 'pargfid' fields
these fields are used mainly in case of selfheal path, where 'inode->gfid'||'parent->gfid' is not yet set. These fields in 'loc' will have lower precedence than 'inode->gfid' in client protocol. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-common.c8
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.c3
2 files changed, 11 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index f000aaf9217..a484fd489f9 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -840,6 +840,10 @@ afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie,
*lookup_buf = *buf;
+ uuid_copy (local->loc.gfid, buf->ia_gfid);
+ uuid_copy (local->loc.pargfid,
+ postparent->ia_gfid);
+
lookup_buf->ia_ino = afr_itransform (buf->ia_ino,
priv->child_count,
child_index);
@@ -869,6 +873,10 @@ afr_fresh_lookup_cbk (call_frame_t *frame, void *cookie,
local->cont.lookup.postparent = *postparent;
*lookup_buf = *buf;
+
+ uuid_copy (local->loc.gfid, buf->ia_gfid);
+ uuid_copy (local->loc.pargfid,
+ postparent->ia_gfid);
}
}
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
index 06559ede08e..30fcf92b60a 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -69,6 +69,9 @@ afr_build_parent_loc (loc_t *parent, loc_t *child)
parent->inode = inode_ref (child->parent);
parent->parent = inode_parent (parent->inode, 0, NULL);
parent->ino = parent->inode->ino;
+
+ if (!uuid_is_null (child->pargfid))
+ uuid_copy (parent->gfid, child->pargfid);
}
/* {{{ create */