summaryrefslogtreecommitdiffstats
path: root/xlators/features/snapview-server/src/snapview-server-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/snapview-server/src/snapview-server-helpers.c')
-rw-r--r--xlators/features/snapview-server/src/snapview-server-helpers.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server-helpers.c b/xlators/features/snapview-server/src/snapview-server-helpers.c
index 38ca7ae6342..dd2e891a849 100644
--- a/xlators/features/snapview-server/src/snapview-server-helpers.c
+++ b/xlators/features/snapview-server/src/snapview-server-helpers.c
@@ -330,6 +330,21 @@ out:
}
void
+svs_uuid_generate (uuid_t gfid, char *snapname, uuid_t origin_gfid)
+{
+ unsigned char md5_sum[MD5_DIGEST_LENGTH] = {0};
+ char ino_string[NAME_MAX + 32] = "";
+ int ret = 0;
+
+ GF_ASSERT (snapname);
+
+ ret = snprintf (ino_string, sizeof (ino_string), "%s%s",
+ snapname, uuid_utoa(origin_gfid));
+ MD5((unsigned char *)ino_string, strlen(ino_string), md5_sum);
+ gf_uuid_copy (gfid, md5_sum);
+}
+
+void
svs_fill_ino_from_gfid (struct iatt *buf)
{
uint64_t temp_ino = 0;