diff options
author | Pavan Vilas Sondur <pavan@gluster.com> | 2009-12-03 14:51:06 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-12-03 12:44:56 -0800 |
commit | e0c09ea80904a26ac932eec546d7675fc0d2cd08 (patch) | |
tree | 65a01c462e580668971def0b3574931996697328 /xlators/features/locks/src/common.c | |
parent | 1c8aa56a1bcff7640b65102782641ab0d53861d2 (diff) |
features/locks: Use lock_owner from fuse in posix locks.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 336 (Use lock owner field from fuse in locks)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=336
Diffstat (limited to 'xlators/features/locks/src/common.c')
-rw-r--r-- | xlators/features/locks/src/common.c | 11 |
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); |