summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks
diff options
context:
space:
mode:
authorPavan Vilas Sondur <pavan@gluster.com>2009-12-03 14:51:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-03 12:45:07 -0800
commit83487d024bcfe671ef83752c8c3a8b56b8dcee2b (patch)
tree34f5138c1cf07d46c8b61b38e32131ec17ddb27d /xlators/features/locks
parent687311adfd08f55de5f70cc89d69c5da0f37a80f (diff)
protocol/server: Changes in protocol client to include lk_owner in protocol header.
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')
-rw-r--r--xlators/features/locks/src/common.c12
-rw-r--r--xlators/features/locks/src/inodelk.c15
2 files changed, 18 insertions, 9 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index 17be81ff2..f53584592 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -782,9 +782,10 @@ __grant_blocked_locks (xlator_t *this, pl_inode_t *pl_inode, struct list_head *g
posix_lock_to_flock (l, &conf->user_flock);
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => Granted",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Granted",
l->fl_type == F_UNLCK ? "Unlock" : "Lock",
l->client_pid,
+ l->owner,
l->user_flock.l_start,
l->user_flock.l_len);
@@ -841,17 +842,19 @@ pl_setlk (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock,
{
if (__is_lock_grantable (pl_inode, lock)) {
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => OK",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => OK",
lock->fl_type == F_UNLCK ? "Unlock" : "Lock",
lock->client_pid,
+ lock->owner,
lock->user_flock.l_start,
lock->user_flock.l_len);
__insert_and_merge (pl_inode, lock);
} else if (can_block) {
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => Blocked",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Blocked",
lock->fl_type == F_UNLCK ? "Unlock" : "Lock",
lock->client_pid,
+ lock->owner,
lock->user_flock.l_start,
lock->user_flock.l_len);
lock->blocked = 1;
@@ -859,9 +862,10 @@ pl_setlk (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock,
ret = -1;
} else {
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => NOK",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => NOK",
lock->fl_type == F_UNLCK ? "Unlock" : "Lock",
lock->client_pid,
+ lock->owner,
lock->user_flock.l_start,
lock->user_flock.l_len);
errno = EAGAIN;
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index f92717c9b..860f038ba 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -214,9 +214,10 @@ __lock_inodelk (xlator_t *this, pl_inode_t *pl_inode, pl_inode_lock_t *lock,
list_add_tail (&lock->blocked_locks, &dom->blocked_inodelks);
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => Blocked",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Blocked",
lock->fl_type == F_UNLCK ? "Unlock" : "Lock",
lock->client_pid,
+ lock->owner,
lock->user_flock.l_start,
lock->user_flock.l_len);
@@ -234,9 +235,10 @@ __lock_inodelk (xlator_t *this, pl_inode_t *pl_inode, pl_inode_lock_t *lock,
gf_log (this->name, GF_LOG_TRACE,
"Lock is grantable, but blocking to prevent starvation");
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => Blocked",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Blocked",
lock->fl_type == F_UNLCK ? "Unlock" : "Lock",
lock->client_pid,
+ lock->owner,
lock->user_flock.l_start,
lock->user_flock.l_len);
@@ -320,9 +322,10 @@ __grant_blocked_inode_locks (xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t
if (bl_ret == 0) {
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => Granted",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Granted",
bl->fl_type == F_UNLCK ? "Unlock" : "Lock",
bl->client_pid,
+ bl->owner,
bl->user_flock.l_start,
bl->user_flock.l_len);
@@ -451,17 +454,19 @@ pl_inode_setlk (xlator_t *this, pl_inode_t *pl_inode, pl_inode_lock_t *lock,
ret = __lock_inodelk (this, pl_inode, lock, can_block, dom);
if (ret == 0)
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => OK",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => OK",
lock->fl_type == F_UNLCK ? "Unlock" : "Lock",
lock->client_pid,
+ lock->owner,
lock->fl_start,
lock->fl_end);
if (ret == -EAGAIN)
gf_log (this->name, GF_LOG_TRACE,
- "%s (pid=%d) %"PRId64" - %"PRId64" => NOK",
+ "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => NOK",
lock->fl_type == F_UNLCK ? "Unlock" : "Lock",
lock->client_pid,
+ lock->owner,
lock->user_flock.l_start,
lock->user_flock.l_len);