summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2016-02-10 06:39:22 +0530
committerRajesh Joseph <rjoseph@redhat.com>2016-03-10 02:43:24 -0800
commite0f71288d95469d7ae82473ef273c6ba43250a36 (patch)
tree3ec70fe1e5d6ece778ff3175b55db7470231a5e7 /tests/include.rc
parentecf6243bc435a00f3dd2495524cd6e48e2d56f72 (diff)
uss/gluster: generate gfid for snapshot files from snapname and gfid
If 'a' and 'b' are hardlinks, we need to generate a virtual gfid for these files so that the inode number for 'a' and 'b' are same. Generate gfid as below: gfid_of_a = MD5(snapname + back_end_gfid(a)) if '/dir1/a' and '/dir2/b' are hardlinks, then inode number should be same for all below files: /mnt/.snaps/snap1/dir1/a /mnt/.snaps/snap1/dir2/b /mnt/dir1/.snaps/snap1/a /mnt/dir2/.snaps/snap1/b Change-Id: Ifda793455610e554f3f1e4cbb90d44c02cda4b0f BUG: 1171703 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9255 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'tests/include.rc')
-rw-r--r--tests/include.rc10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc
index b46a7b2fde4..6f224833bf9 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -1137,3 +1137,13 @@ function STAT()
stat $1
echo $?
}
+
+function STAT_INO()
+{
+ local ino=$(stat -c '%i' $1)
+ if [ $? -eq 0 ]; then
+ echo $ino
+ else
+ echo 0
+ fi
+}