summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/xlator.c17
-rw-r--r--libglusterfs/src/xlator.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 22a494d01a5..5c91380be15 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 ca30f99650e..61d904f4d58 100644
--- a/libglusterfs/src/xlator.h
+++ b/libglusterfs/src/xlator.h
@@ -963,6 +963,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);