summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/inodelk.c
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-08-22 14:09:48 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-22 22:27:49 -0700
commit0d33cce6f7bbb71abe0086469f2f726151b0e62c (patch)
tree74192cf39d8963889a4f37182d2bed229e99d347 /xlators/features/locks/src/inodelk.c
parent63f9e2a49573a0b539c0082fd0c08c1b4d4db983 (diff)
protocol/server: features/locks: Fix nonblocking entrylks, inodelks in locks and server.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 960 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=960
Diffstat (limited to 'xlators/features/locks/src/inodelk.c')
-rw-r--r--xlators/features/locks/src/inodelk.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index 592d14e08..eaae8d4de 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -130,13 +130,8 @@ static int same_inodelk_owner (pl_inode_lock_t *l1, pl_inode_lock_t *l2)
static int
inodelk_conflict (pl_inode_lock_t *l1, pl_inode_lock_t *l2)
{
- if (same_inodelk_owner (l1, l2))
- return 0;
-
- if (!inodelk_overlap (l1, l2))
- return 0;
-
- return (inodelk_type_conflict(l1, l2));
+ return (inodelk_overlap (l1, l2) &&
+ inodelk_type_conflict (l1, l2));
}
/* Determine if lock is grantable or not */
@@ -271,7 +266,8 @@ find_matching_inodelk (pl_inode_lock_t *lock, pl_dom_list_t *dom)
{
pl_inode_lock_t *l = NULL;
list_for_each_entry (l, &dom->inodelk_list, list) {
- if (inodelks_equal (l, lock))
+ if (inodelks_equal (l, lock) &&
+ same_inodelk_owner (l, lock))
return l;
}
return NULL;
@@ -582,7 +578,7 @@ pl_common_inodelk (call_frame_t *frame, xlator_t *this,
dom = get_domain (pinode, volume);
- if (client_pid == 0) {
+ if (owner == 0) {
/*
special case: this means release all locks
from this transport
@@ -604,6 +600,9 @@ pl_common_inodelk (call_frame_t *frame, xlator_t *this,
goto unwind;
}
+ reqlock->frame = frame;
+ reqlock->this = this;
+
switch (cmd) {
case F_SETLKW:
can_block = 1;