diff options
author | Mohamed Ashiq <ashiq333@gmail.com> | 2015-05-27 15:20:59 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2015-06-10 01:58:01 -0700 |
commit | 00f9a61fe8884062c141edd662424625d349a377 (patch) | |
tree | dc3cfe0975d5517f9257574ad8b799d14ac0ee86 /xlators/features/changetimerecorder/src/ctr-xlator-ctx.c | |
parent | 2847b03a38515a625e36d52c7e0a1d37107d72ba (diff) |
changetimerecorder : Porting to new logging framework
Change-Id: I66e7ccc5e62482c3ecf0aab302568e6c9ecdc05d
BUG: 1194640
Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com>
Reviewed-on: http://review.gluster.org/10938
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Joseph Fernandes
Diffstat (limited to 'xlators/features/changetimerecorder/src/ctr-xlator-ctx.c')
-rw-r--r-- | xlators/features/changetimerecorder/src/ctr-xlator-ctx.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/xlators/features/changetimerecorder/src/ctr-xlator-ctx.c b/xlators/features/changetimerecorder/src/ctr-xlator-ctx.c index 927c8542c4e..a91a2bbefc0 100644 --- a/xlators/features/changetimerecorder/src/ctr-xlator-ctx.c +++ b/xlators/features/changetimerecorder/src/ctr-xlator-ctx.c @@ -9,6 +9,7 @@ */ #include "ctr-xlator-ctx.h" +#include "ctr-messages.h" #define IS_THE_ONLY_HARDLINK(ctr_hard_link)\ (ctr_hard_link->list.next == ctr_hard_link->list.prev) @@ -79,8 +80,9 @@ ctr_add_hard_link (xlator_t *this, ctr_hard_link = GF_CALLOC (1, sizeof (*ctr_hard_link), gf_ctr_mt_hard_link_t); if (!ctr_hard_link) { - gf_log (this->name, GF_LOG_ERROR, "Failed allocating " - "ctr_hard_link"); + gf_msg (this->name, GF_LOG_ERROR, ENOMEM, + CTR_MSG_CALLOC_FAILED, "Failed allocating " + "ctr_hard_link"); goto out; } @@ -90,8 +92,9 @@ ctr_add_hard_link (xlator_t *this, gf_uuid_copy (ctr_hard_link->pgfid, pgfid); ret = gf_asprintf(&ctr_hard_link->base_name, "%s", base_name); if (ret < 0) { - gf_log (this->name, GF_LOG_ERROR, "Failed copying basename" - "to ctr_hard_link"); + gf_msg (this->name, GF_LOG_ERROR, 0, + CTR_MSG_COPY_FAILED, "Failed copying basename" + "to ctr_hard_link"); goto error; } @@ -139,8 +142,9 @@ ctr_delete_hard_link (xlator_t *this, ctr_hard_link = ctr_search_hard_link_ctx (this, ctr_xlator_ctx, pgfid, base_name); if (!ctr_hard_link) { - gf_log (this->name, GF_LOG_ERROR, "Hard link doesnt exist" - " in the list"); + gf_msg (this->name, GF_LOG_ERROR, 0, + CTR_MSG_HARDLINK_MISSING_IN_LIST, + "Hard link doesnt exist in the list"); goto out; } @@ -178,15 +182,16 @@ ctr_update_hard_link (xlator_t *this, ctr_hard_link = ctr_search_hard_link_ctx (this, ctr_xlator_ctx, old_pgfid, old_base_name); if (!ctr_hard_link) { - gf_log (this->name, GF_LOG_TRACE, "Hard link doesnt exist" - " in the list"); + gf_msg_trace (this->name, 0, "Hard link doesnt exist" + " in the list"); /* Since the hard link is not present in the list * we add it to the list */ ret = ctr_add_hard_link (this, ctr_xlator_ctx, pgfid, base_name); if (ret) { - gf_log (this->name, GF_LOG_ERROR, "Failed adding" - "hard link to the list"); + gf_msg (this->name, GF_LOG_ERROR, 0, + CTR_MSG_ADD_HARDLINK_TO_LIST_FAILED, + "Failed adding hard link to the list"); goto out; } ret = 0; @@ -198,7 +203,8 @@ ctr_update_hard_link (xlator_t *this, GF_FREE (&ctr_hard_link->base_name); ret = gf_asprintf(&ctr_hard_link->base_name, "%s", base_name); if (ret < 0) { - gf_log (this->name, GF_LOG_ERROR, "Failed copying basename" + gf_msg (this->name, GF_LOG_ERROR, 0, + CTR_MSG_COPY_FAILED, "Failed copying basename" "to ctr_hard_link"); /* delete the corrupted entry */ __delete_hard_link_from_list (&ctr_hard_link); @@ -296,8 +302,9 @@ init_ctr_xlator_ctx (xlator_t *this, ret = LOCK_INIT (&ctr_xlator_ctx->lock); if (ret) { - gf_log (this->name, GF_LOG_ERROR, - "Failed init lock %s", strerror(ret)); + gf_msg (this->name, GF_LOG_ERROR, ret, + CTR_MSG_INIT_LOCK_FAILED, + "Failed init lock %s", strerror(ret)); goto out; } _addr = (uint64_t) ctr_xlator_ctx; @@ -342,8 +349,9 @@ fini_ctr_xlator_ctx (xlator_t *this, ret = ctr_delete_all_hard_link (this, ctr_xlator_ctx); if (ret) { - gf_log (this->name, GF_LOG_WARNING , "Failed deleting all hard" - " links from inode context"); + gf_msg (this->name, GF_LOG_WARNING , 0, + CTR_MSG_DELETE_HARDLINK_FAILED, "Failed deleting all " + "hard links from inode context"); } LOCK_DESTROY (&ctr_xlator_ctx->lock); |