summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/fd-lk.c
diff options
context:
space:
mode:
authorMohamed Ashiq <ashiq333@gmail.com>2015-05-19 15:34:43 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-07-07 05:18:35 -0700
commit36f24f5fc358598b55fb176cefe944ea5160c012 (patch)
treed8ea5dfc3c732463451abb7e9f55cf6858310901 /libglusterfs/src/fd-lk.c
parent0c0e1d564f5a0f834169af6171d609a786cb3792 (diff)
fd,inode/libglusterfs : porting to a new logging framework
Backport of http://review.gluster.org/#/c/10825/ Cherry picked from d32b221747cf6742cffaff5a60e16269dffd04cc >Change-Id: I4beba3b50456f802824374b6e3fa8079d72f2c00 >BUG: 1194640 >Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com> >Reviewed-on: http://review.gluster.org/10825 >Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> >Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Change-Id: I4beba3b50456f802824374b6e3fa8079d72f2c00 BUG: 1217722 Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com> Reviewed-on: http://review.gluster.org/11402 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'libglusterfs/src/fd-lk.c')
-rw-r--r--libglusterfs/src/fd-lk.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/libglusterfs/src/fd-lk.c b/libglusterfs/src/fd-lk.c
index 3c1befea966..01c6c1a0157 100644
--- a/libglusterfs/src/fd-lk.c
+++ b/libglusterfs/src/fd-lk.c
@@ -10,7 +10,7 @@
#include "fd-lk.h"
#include "common-utils.h"
-
+#include "libglusterfs-messages.h"
int32_t
_fd_lk_delete_lock (fd_lk_ctx_node_t *lock)
@@ -89,8 +89,8 @@ fd_lk_ctx_t *
_fd_lk_ctx_ref (fd_lk_ctx_t *lk_ctx)
{
if (!lk_ctx) {
- gf_log_callingfn ("fd", GF_LOG_WARNING,
- "invalid argument");
+ gf_msg_callingfn ("fd-lk", GF_LOG_WARNING, EINVAL,
+ LG_MSG_INVALID_ARG, "invalid argument");
return NULL;
}
@@ -105,8 +105,8 @@ fd_lk_ctx_ref (fd_lk_ctx_t *lk_ctx)
fd_lk_ctx_t *new_lk_ctx = NULL;
if (!lk_ctx) {
- gf_log_callingfn ("fd", GF_LOG_WARNING,
- "invalid argument");
+ gf_msg_callingfn ("fd-lk", GF_LOG_WARNING, EINVAL,
+ LG_MSG_INVALID_ARG, "invalid argument");
return NULL;
}
@@ -418,19 +418,18 @@ print_lock_list (fd_lk_ctx_t *lk_ctx)
{
fd_lk_ctx_node_t *lk = NULL;
- gf_log ("fd-lk", GF_LOG_DEBUG, "lock list:");
+ gf_msg_debug ("fd-lk", 0, "lock list:");
list_for_each_entry (lk, &lk_ctx->lk_list, next)
- gf_log ("fd-lk", GF_LOG_DEBUG, "owner = %s, "
- "cmd = %s fl_type = %s, fs_start = %"PRId64", "
- "fs_end = %"PRId64", user_flock: l_type = %s, "
- "l_start = %"PRId64", l_len = %"PRId64", ",
- lkowner_utoa (&lk->user_flock.l_owner),
- get_lk_cmd (lk->cmd), get_lk_type (lk->fl_type),
- lk->fl_start, lk->fl_end,
- get_lk_type (lk->user_flock.l_type),
- lk->user_flock.l_start,
- lk->user_flock.l_len);
+ gf_msg_debug ("fd-lk", 0, "owner = %s, cmd = %s fl_type = %s,"
+ " fs_start = %"PRId64", fs_end = %"PRId64", "
+ "user_flock: l_type = %s, l_start = %"PRId64", "
+ "l_len = %"PRId64", ",
+ lkowner_utoa (&lk->user_flock.l_owner),
+ get_lk_cmd (lk->cmd), get_lk_type (lk->fl_type),
+ lk->fl_start, lk->fl_end,
+ get_lk_type (lk->user_flock.l_type),
+ lk->user_flock.l_start, lk->user_flock.l_len);
}
int
@@ -447,15 +446,13 @@ fd_lk_insert_and_merge (fd_t *fd, int32_t cmd,
lk_ctx = fd_lk_ctx_ref (fd->lk_ctx);
lk = fd_lk_ctx_node_new (cmd, flock);
- gf_log ("fd-lk", GF_LOG_DEBUG,
- "new lock requrest: owner = %s, fl_type = %s, "
- "fs_start = %"PRId64", fs_end = %"PRId64", "
- "user_flock: l_type = %s, l_start = %"PRId64", "
- "l_len = %"PRId64, lkowner_utoa (&flock->l_owner),
- get_lk_type (lk->fl_type), lk->fl_start,
- lk->fl_end, get_lk_type (lk->user_flock.l_type),
- lk->user_flock.l_start,
- lk->user_flock.l_len);
+ gf_msg_debug ("fd-lk", 0, "new lock requrest: owner = %s, fl_type = %s"
+ ", fs_start = %"PRId64", fs_end = %"PRId64", user_flock:"
+ " l_type = %s, l_start = %"PRId64", l_len = %"PRId64,
+ lkowner_utoa (&flock->l_owner),
+ get_lk_type (lk->fl_type), lk->fl_start, lk->fl_end,
+ get_lk_type (lk->user_flock.l_type),
+ lk->user_flock.l_start, lk->user_flock.l_len);
LOCK (&lk_ctx->lock);
{