summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/locks/src/common.c')
-rw-r--r--xlators/features/locks/src/common.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index fb011fe6a7a..17be81ff24c 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -421,7 +421,7 @@ out:
/* Create a new posix_lock_t */
posix_lock_t *
-new_posix_lock (struct flock *flock, transport_t *transport, pid_t client_pid)
+new_posix_lock (struct flock *flock, transport_t *transport, pid_t client_pid, uint64_t owner)
{
posix_lock_t *lock = NULL;
@@ -440,6 +440,7 @@ new_posix_lock (struct flock *flock, transport_t *transport, pid_t client_pid)
lock->transport = transport;
lock->client_pid = client_pid;
+ lock->owner = owner;
INIT_LIST_HEAD (&lock->list);
@@ -507,8 +508,10 @@ locks_overlap (posix_lock_t *l1, posix_lock_t *l2)
int
same_owner (posix_lock_t *l1, posix_lock_t *l2)
{
- return ((l1->client_pid == l2->client_pid) &&
- (l1->transport == l2->transport));
+
+ return ((l1->owner == l2->owner) &&
+ (l1->transport == l2->transport));
+
}
@@ -680,6 +683,7 @@ __insert_and_merge (pl_inode_t *pl_inode, posix_lock_t *lock)
sum->fl_type = lock->fl_type;
sum->transport = lock->transport;
sum->client_pid = lock->client_pid;
+ sum->owner = lock->owner;
__delete_lock (pl_inode, conf);
__destroy_lock (conf);
@@ -694,6 +698,7 @@ __insert_and_merge (pl_inode_t *pl_inode, posix_lock_t *lock)
sum->fl_type = conf->fl_type;
sum->transport = conf->transport;
sum->client_pid = conf->client_pid;
+ sum->owner = conf->owner;
v = subtract_locks (sum, lock);