From ab2558a3e7a1b2de2d63a3812ab4ed58d10d8619 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Sun, 16 Jul 2017 15:16:56 -0400 Subject: storage/posix: Add virtual xattr to fetch path from gfid The gfid2path infra stores the "pargfid/bname" as on xattr value for each non directory entry. Hardlinks would have a separate xattr. This xattr key is internal and is not exposed to applications. A virtual xattr is exposed for the applications to fetch the path from gfid. Internal xattr: trusted.gfid2path. Virtual xattr: glusterfs.gfidtopath getfattr -h -n glusterfs.gfidtopath //.gfid/ If there are hardlinks, it returns all the paths separated by ':'. A volume set option is introduced to change the delimiter to required string of max length 7. gluster vol set gfid2path-separator ":::" Updates: #139 Change-Id: Ie3b0c3fd8bd5333c4a27410011e608333918c02a Signed-off-by: Kotresh HR Reviewed-on: https://review.gluster.org/17785 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Krutika Dhananjay --- xlators/storage/posix/src/posix-gfid-path.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/storage/posix/src/posix-gfid-path.h') diff --git a/xlators/storage/posix/src/posix-gfid-path.h b/xlators/storage/posix/src/posix-gfid-path.h index b1a23752e8f..ac3d03e14c3 100644 --- a/xlators/storage/posix/src/posix-gfid-path.h +++ b/xlators/storage/posix/src/posix-gfid-path.h @@ -24,4 +24,7 @@ posix_remove_gfid2path_xattr (xlator_t *, const char *, uuid_t, const char *); gf_boolean_t posix_is_gfid2path_xattr (const char *name); +int32_t +posix_get_gfid2path (xlator_t *this, inode_t *inode, const char *real_path, + int *op_errno, dict_t *dict); #endif /* _POSIX_GFID_PATH_H */ -- cgit