diff options
author | Raghavendra G <raghavendra@gluster.com> | 2012-10-17 16:10:28 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-11-27 22:54:27 -0800 |
commit | 8fd4aa74149411ab739e2075e1f7c0709b8a0342 (patch) | |
tree | b1be85d05864053ab095ec0c4025a3a13fde34a2 /xlators/features/locks/src/locks.h | |
parent | dbc0968db04f09a57b3a2165803f8103c98c9acb (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 'xlators/features/locks/src/locks.h')
-rw-r--r-- | xlators/features/locks/src/locks.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h index d2b47bffed7..7ffc67e1b88 100644 --- a/xlators/features/locks/src/locks.h +++ b/xlators/features/locks/src/locks.h @@ -149,6 +149,7 @@ typedef struct __pl_fd pl_fd_t; typedef struct { gf_boolean_t mandatory; /* if mandatory locking is enabled */ gf_boolean_t trace; /* trace lock requests in and out */ + char *brickname; } posix_locks_private_t; typedef struct { |