summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/timer.c
diff options
context:
space:
mode:
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;
}