summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/timer.c
diff options
context:
space:
mode:
authorMohamed Ashiq <ashiq333@gmail.com>2015-05-19 15:46:01 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-06-26 22:52:01 -0700
commit2b9b3ef3b646989bbc0412dca187b3f5fcad3283 (patch)
tree6426321e1e0ac95e8afb12ab3e3047b7625e18a0 /libglusterfs/src/timer.c
parentf5f5cef19e2afa1e2bcee896269e004353d3180f (diff)
mem-pool,stack,store,syncop,timer/libglusterfs : Porting to a new logging framework
Change-Id: Idd3dcaf7eeea5207b3a5210676ce3df64153197f BUG: 1194640 Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com> Reviewed-on: http://review.gluster.org/10827 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs/src/timer.c')
-rw-r--r--libglusterfs/src/timer.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c
index 1aa2079f097..b406ef613d6 100644
--- a/libglusterfs/src/timer.c
+++ b/libglusterfs/src/timer.c
@@ -13,6 +13,7 @@
#include "common-utils.h"
#include "globals.h"
#include "timespec.h"
+#include "libglusterfs-messages.h"
gf_timer_t *
gf_timer_call_after (glusterfs_ctx_t *ctx,
@@ -27,7 +28,8 @@ gf_timer_call_after (glusterfs_ctx_t *ctx,
if (ctx == NULL)
{
- gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument");
+ gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL,
+ LG_MSG_INVALID_ARG, "invalid argument");
return NULL;
}
@@ -36,14 +38,17 @@ gf_timer_call_after (glusterfs_ctx_t *ctx,
* when cleanup_started is set after checking for it
*/
if (ctx->cleanup_started) {
- gf_log_callingfn ("timer", GF_LOG_INFO, "ctx cleanup started");
+ gf_msg_callingfn ("timer", GF_LOG_INFO, 0,
+ LG_MSG_CTX_CLEANUP_STARTED, "ctx cleanup "
+ "started");
return NULL;
}
reg = gf_timer_registry_init (ctx);
if (!reg) {
- gf_log_callingfn ("timer", GF_LOG_ERROR, "!reg");
+ gf_msg_callingfn ("timer", GF_LOG_ERROR, 0,
+ LG_MSG_TIMER_REGISTER_ERROR, "!reg");
return NULL;
}
@@ -80,7 +85,8 @@ gf_timer_call_stale (gf_timer_registry_t *reg,
{
if (reg == NULL || event == NULL)
{
- gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument");
+ gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL,
+ LG_MSG_INVALID_ARG, "invalid argument");
return 0;
}
@@ -102,13 +108,15 @@ gf_timer_call_cancel (glusterfs_ctx_t *ctx,
if (ctx == NULL || event == NULL)
{
- gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument");
+ gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL,
+ LG_MSG_INVALID_ARG, "invalid argument");
return 0;
}
reg = gf_timer_registry_init (ctx);
if (!reg) {
- gf_log ("timer", GF_LOG_ERROR, "!reg");
+ gf_msg ("timer", GF_LOG_ERROR, 0, LG_MSG_INIT_TIMER_FAILED,
+ "!reg");
GF_FREE (event);
return 0;
}
@@ -140,13 +148,15 @@ gf_timer_proc (void *ctx)
if (ctx == NULL)
{
- gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument");
+ gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL,
+ LG_MSG_INVALID_ARG, "invalid argument");
return NULL;
}
reg = gf_timer_registry_init (ctx);
if (!reg) {
- gf_log ("timer", GF_LOG_ERROR, "!reg");
+ gf_msg ("timer", GF_LOG_ERROR, 0, LG_MSG_INIT_TIMER_FAILED,
+ "!reg");
return NULL;
}
@@ -218,7 +228,8 @@ gf_timer_registry_t *
gf_timer_registry_init (glusterfs_ctx_t *ctx)
{
if (ctx == NULL) {
- gf_log_callingfn ("timer", GF_LOG_ERROR, "invalid argument");
+ gf_msg_callingfn ("timer", GF_LOG_ERROR, EINVAL,
+ LG_MSG_INVALID_ARG, "invalid argument");
return NULL;
}