From 53af855f2aad8c19f2bbc7561534b473ae8c7dc4 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 4 May 2011 04:14:02 +0000 Subject: cluster/afr: set loc gfids for fresh lookup Signed-off-by: Pranith Kumar K Signed-off-by: Anand Avati BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346 --- xlators/cluster/afr/src/afr-common.c | 10 ++++++++++ xlators/cluster/afr/src/afr-self-heal-entry.c | 2 ++ xlators/cluster/afr/src/afr.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 682c5854a..b1dd649ae 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -497,6 +497,16 @@ afr_up_children_count (int child_count, unsigned char *child_up) return ret; } +void +afr_update_loc_gfids (loc_t *loc, struct iatt *buf, struct iatt *postparent) +{ + GF_ASSERT (loc); + GF_ASSERT (buf); + + uuid_copy (loc->gfid, buf->ia_gfid); + if (postparent) + uuid_copy (loc->pargfid, postparent->ia_gfid); +} ino64_t afr_itransform (ino64_t ino, int child_count, int child_index) diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 88bf2448d..ea2092c67 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -1568,6 +1568,8 @@ afr_sh_entry_impunge_recreate_lookup_cbk (call_frame_t *impunge_frame, impunge_sh->parentbuf = *postparent; impunge_local->cont.lookup.buf = *buf; + afr_update_loc_gfids (&impunge_local->loc, buf, postparent); + type = buf->ia_type; switch (type) { diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index f1b0efbd2..679fc5e4e 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -734,6 +734,9 @@ afr_build_parent_loc (loc_t *parent, loc_t *child); int afr_up_children_count (int child_count, unsigned char *child_up); +void +afr_update_loc_gfids (loc_t *loc, struct iatt *buf, struct iatt *postparent); + int afr_locked_nodes_count (unsigned char *locked_nodes, int child_count); -- cgit