diff options
-rw-r--r-- | libglusterfs/src/xlator.c | 17 | ||||
-rw-r--r-- | libglusterfs/src/xlator.h | 1 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 6 | ||||
-rw-r--r-- | xlators/features/shard/src/shard.c | 1 |
4 files changed, 23 insertions, 2 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 2221332a092..3c1cde50fa0 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -762,6 +762,23 @@ out: return; } +void +loc_pargfid (loc_t *loc, uuid_t gfid) +{ + if (!gfid) + goto out; + gf_uuid_clear (gfid); + + if (!loc) + goto out; + else if (!gf_uuid_is_null (loc->pargfid)) + gf_uuid_copy (gfid, loc->pargfid); + else if (loc->parent && (!gf_uuid_is_null (loc->parent->gfid))) + gf_uuid_copy (gfid, loc->parent->gfid); +out: + return; +} + char* loc_gfid_utoa (loc_t *loc) { diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index 555916d2adb..70e6f0a108d 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -1011,6 +1011,7 @@ int loc_copy_overload_parent (loc_t *dst, void loc_wipe (loc_t *loc); int loc_path (loc_t *loc, const char *bname); void loc_gfid (loc_t *loc, uuid_t gfid); +void loc_pargfid (loc_t *loc, uuid_t pargfid); char* loc_gfid_utoa (loc_t *loc); gf_boolean_t loc_is_root (loc_t *loc); int32_t loc_build_child (loc_t *child, loc_t *parent, char *name); diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index e77f0dd6891..d503609e8a2 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -2342,12 +2342,14 @@ afr_lookup_selfheal_wrap (void *opaque) afr_local_t *local = NULL; xlator_t *this = NULL; inode_t *inode = NULL; + uuid_t pargfid = {0,}; local = frame->local; this = frame->this; + loc_pargfid (&local->loc, pargfid); - ret = afr_selfheal_name (frame->this, local->loc.pargfid, - local->loc.name, &local->cont.lookup.gfid_req); + ret = afr_selfheal_name (frame->this, pargfid, local->loc.name, + &local->cont.lookup.gfid_req); if (ret == -EIO) goto unwind; diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index c704ad14017..bdd8934244c 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -1678,6 +1678,7 @@ shard_common_lookup_shards (call_frame_t *frame, xlator_t *this, inode_t *inode, bname = strrchr (path, '/') + 1; loc.inode = inode_new (this->itable); loc.parent = inode_ref (priv->dot_shard_inode); + gf_uuid_copy (loc.pargfid, priv->dot_shard_gfid); ret = inode_path (loc.parent, bname, (char **) &(loc.path)); if (ret < 0 || !(loc.inode)) { gf_msg (this->name, GF_LOG_ERROR, 0, |