summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/common.c
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2009-10-28 17:04:33 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-29 00:52:53 -0700
commit82c0df9941abfb4836947fce1ff9da266dbd7499 (patch)
tree6d40cf1727ccc6f7d8b241e4248407a136b3648f /xlators/features/locks/src/common.c
parent08327b6a6bdb7a3807a9d279b6d5f99686d13b99 (diff)
Print inodelks in and out if option trace is on.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 306 (Enhance locks to aid debugging) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=306
Diffstat (limited to 'xlators/features/locks/src/common.c')
-rw-r--r--xlators/features/locks/src/common.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index 040b95469..fb011fe6a 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -218,7 +218,7 @@ pl_print_lock (char *str, int size, int cmd, struct flock *flock)
void
pl_trace_in (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock)
+ int cmd, struct flock *flock, const char *domain)
{
posix_locks_private_t *priv = NULL;
char pl_locker[256];
@@ -232,7 +232,10 @@ pl_trace_in (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
pl_print_locker (pl_locker, 256, this, frame);
pl_print_lockee (pl_lockee, 256, fd, loc);
- pl_print_lock (pl_lock, 256, cmd, flock);
+ if (domain)
+ pl_print_inodelk (pl_lock, 256, cmd, flock, domain);
+ else
+ pl_print_lock (pl_lock, 256, cmd, flock);
gf_log (this->name, GF_LOG_NORMAL,
"[REQUEST] Locker = {%s} Lockee = {%s} Lock = {%s}",
@@ -263,7 +266,7 @@ pl_print_verdict (char *str, int size, int op_ret, int op_errno)
void
pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock, int op_ret, int op_errno)
+ int cmd, struct flock *flock, int op_ret, int op_errno, const char *domain)
{
posix_locks_private_t *priv = NULL;
@@ -279,7 +282,11 @@ pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
pl_print_locker (pl_locker, 256, this, frame);
pl_print_lockee (pl_lockee, 256, fd, loc);
- pl_print_lock (pl_lock, 256, cmd, flock);
+ if (domain)
+ pl_print_inodelk (pl_lock, 256, cmd, flock, domain);
+ else
+ pl_print_lock (pl_lock, 256, cmd, flock);
+
pl_print_verdict (verdict, 32, op_ret, op_errno);
gf_log (this->name, GF_LOG_NORMAL,
@@ -290,7 +297,7 @@ pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
void
pl_trace_block (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
- int cmd, struct flock *flock)
+ int cmd, struct flock *flock, const char *domain)
{
posix_locks_private_t *priv = NULL;
@@ -305,7 +312,10 @@ pl_trace_block (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc,
pl_print_locker (pl_locker, 256, this, frame);
pl_print_lockee (pl_lockee, 256, fd, loc);
- pl_print_lock (pl_lock, 256, cmd, flock);
+ if (domain)
+ pl_print_inodelk (pl_lock, 256, cmd, flock, domain);
+ else
+ pl_print_lock (pl_lock, 256, cmd, flock);
gf_log (this->name, GF_LOG_NORMAL,
"[BLOCKED] Locker = {%s} Lockee = {%s} Lock = {%s}",
@@ -803,7 +813,7 @@ grant_blocked_locks (xlator_t *this, pl_inode_t *pl_inode)
list_del_init (&lock->list);
pl_trace_out (this, lock->frame, NULL, NULL, F_SETLKW,
- &lock->user_flock, 0, 0);
+ &lock->user_flock, 0, 0, NULL);
STACK_UNWIND (lock->frame, 0, 0, &lock->user_flock);