summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/common.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2016-04-17 10:17:42 +0530
committerNiels de Vos <ndevos@redhat.com>2016-05-01 18:04:36 -0700
commit90a8d15ea9778b5089521767137b14cb52b9a2b3 (patch)
tree3f9d562aefbc67ac3973c15ca60279bd3c055803 /xlators/features/locks/src/common.c
parent2cca000fcc2adbffbb3f5258c57ae564b9e2d51f (diff)
posix/lock: add getactivelk () fop
Change-Id: I99e41a80854d6f90572df755e14757099ae1236f BUG: 1326085 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/13995 Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/locks/src/common.c')
-rw-r--r--xlators/features/locks/src/common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index 1c43ef16179..c6db18f6ba8 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -469,6 +469,13 @@ new_posix_lock (struct gf_flock *flock, client_t *client, pid_t client_pid,
lock->fl_end = flock->l_start + flock->l_len - 1;
lock->client = client;
+
+ lock->client_uid = gf_strdup (client->client_uid);
+ if (lock->client_uid == NULL) {
+ GF_FREE (lock);
+ goto out;
+ }
+
lock->fd_num = fd_to_fdnum (fd);
lock->fd = fd;
lock->client_pid = client_pid;
@@ -783,6 +790,7 @@ __insert_and_merge (pl_inode_t *pl_inode, posix_lock_t *lock)
posix_lock_t *sum = NULL;
int i = 0;
struct _values v = { .locks = {0, 0, 0} };
+ client_t *client = NULL;
list_for_each_entry_safe (conf, t, &pl_inode->ext_list, list) {
if (conf->blocked)
@@ -796,6 +804,9 @@ __insert_and_merge (pl_inode_t *pl_inode, posix_lock_t *lock)
sum->fl_type = lock->fl_type;
sum->client = lock->client;
+ client = sum->client;
+ sum->client_uid =
+ gf_strdup (client->client_uid);
sum->fd_num = lock->fd_num;
sum->client_pid = lock->client_pid;
sum->owner = lock->owner;
@@ -814,6 +825,10 @@ __insert_and_merge (pl_inode_t *pl_inode, posix_lock_t *lock)
sum->fl_type = conf->fl_type;
sum->client = conf->client;
+ client = sum->client;
+ sum->client_uid =
+ gf_strdup (client->client_uid);
+
sum->fd_num = conf->fd_num;
sum->client_pid = conf->client_pid;
sum->owner = conf->owner;