From 32e366bad947926343fdb389f054ca3051e44774 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 Updates: #139 Change-Id: Ie3b0c3fd8bd5333c4a27410011e608333918c02a Signed-off-by: Kotresh HR Reviewed-on: https://review.gluster.org/17921 CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- xlators/mgmt/glusterd/src/glusterd-volume-set.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-set.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 4c07d3118af..2983484d12e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -2795,6 +2795,11 @@ struct volopt_map_entry glusterd_volopt_map[] = { .voltype = "storage/posix", .op_version = GD_OP_VERSION_3_12_0, }, + { .option = "gfid2path-separator", + .key = "storage.gfid2path-separator", + .voltype = "storage/posix", + .op_version = GD_OP_VERSION_3_12_0, + }, { .key = "storage.bd-aio", .voltype = "storage/bd", .op_version = 3 -- cgit