From 8fd4aa74149411ab739e2075e1f7c0709b8a0342 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 17 Oct 2012 16:10:28 +0530 Subject: features/locks: implement fgetxattr and fsetxattr implement xattrs for GF_XATTR_LOCKINFO_KEY, which will be used for posix-locks migration from old to new graph after a switch. fgetxattr (fd, GF_XATTR_LOCKINFO_KEY) will return a dict. This dict has a serialized dict stored for key GF_XATTR_LOCKINFO_KEY. This serialized dict in turn has fdnum value of locks acquired on this fd with modified pathinfo (containing hostname and base directory components) as key. fsetxattr (newfd, GF_XATTR_LOCKINFO_KEY, dict) has following semantics. dict can be the result of a previous fgetxattr with GF_XATTR_LOCKINFO_KEY. In that case, a dict_get on dict constructed using serialized buffer is done on modified pathinfo as key. If a value is got, that value is treated as fdnum and for every lock l on newfd->inode we do, if (l->fdnum == fdnum) { l->fdnum = fd_fdnum (newfd); l->transport = ; } Signed-off-by: Raghavendra G Change-Id: I73a8f43aa0b6077bc19f8de52205ba748f2d8bbe BUG: 808400 Reviewed-on: http://review.gluster.org/4120 Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- libglusterfs/src/glusterfs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 92e481e04..61edd5ec7 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -82,6 +82,7 @@ #define GF_XATTR_PATHINFO_KEY "trusted.glusterfs.pathinfo" #define GF_XATTR_NODE_UUID_KEY "trusted.glusterfs.node-uuid" #define GF_XATTR_VOL_ID_KEY "trusted.glusterfs.volume-id" +#define GF_XATTR_LOCKINFO_KEY "trusted.glusterfs.lockinfo" #define GF_READDIR_SKIP_DIRS "readdir-filter-directories" -- cgit