summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/glusterfs.h
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2012-10-17 16:10:28 +0530
committerVijay Bellur <vbellur@redhat.com>2012-11-27 22:54:27 -0800
commit8fd4aa74149411ab739e2075e1f7c0709b8a0342 (patch)
treeb1be85d05864053ab095ec0c4025a3a13fde34a2 /libglusterfs/src/glusterfs.h
parentdbc0968db04f09a57b3a2165803f8103c98c9acb (diff)
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 = <connection identifier of connection on which fsetxattr came>; } Signed-off-by: Raghavendra G <raghavendra@gluster.com> Change-Id: I73a8f43aa0b6077bc19f8de52205ba748f2d8bbe BUG: 808400 Reviewed-on: http://review.gluster.org/4120 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/glusterfs.h')
-rw-r--r--libglusterfs/src/glusterfs.h1
1 files changed, 1 insertions, 0 deletions
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"