From 2dcc68df252f9f8313eb8f8b2e1e97f539426643 Mon Sep 17 00:00:00 2001 From: Manikandan Selvaganesh Date: Mon, 6 Apr 2015 16:21:43 +0530 Subject: protocol/client : porting log messages to new framework Backport of http://review.gluster.org/#/c/10042/ Cherry picked from 379dbbfd683d2b0e1704c098b1f020567328122c > Change-Id: I9bf2ca08fef969e566a64475d0f7a16d37e66eeb > BUG: 1194640 > Signed-off-by: Manikandan Selvaganesh > Reviewed-on: http://review.gluster.org/10042 > Tested-by: Gluster Build System > Reviewed-by: Raghavendra G > Tested-by: Raghavendra G Change-Id: I9bf2ca08fef969e566a64475d0f7a16d37e66eeb BUG: 1217722 Signed-off-by: Manikandan Selvaganesh Reviewed-on: http://review.gluster.org/11240 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Raghavendra G Tested-by: Raghavendra G --- xlators/protocol/client/src/client-helpers.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'xlators/protocol/client/src/client-helpers.c') diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c index be5e7b57739..62fbc6c9af9 100644 --- a/xlators/protocol/client/src/client-helpers.c +++ b/xlators/protocol/client/src/client-helpers.c @@ -15,6 +15,7 @@ #include "client.h" #include "fd.h" +#include "client-messages.h" int client_fd_lk_list_empty (fd_lk_ctx_t *lk_ctx, gf_boolean_t try_lock) @@ -94,22 +95,26 @@ this_fd_set_ctx (fd_t *file, xlator_t *this, loc_t *loc, clnt_fd_ctx_t *ctx) ret = fd_ctx_get (file, this, &oldaddr); if (ret >= 0) { if (loc) - gf_log (this->name, GF_LOG_INFO, + gf_msg (this->name, GF_LOG_INFO, 0, + PC_MSG_FD_DUPLICATE_TRY, "%s (%s): trying duplicate remote fd set. ", loc->path, uuid_utoa (loc->inode->gfid)); else - gf_log (this->name, GF_LOG_INFO, + gf_msg (this->name, GF_LOG_INFO, 0, + PC_MSG_FD_DUPLICATE_TRY, "%p: trying duplicate remote fd set. ", file); } ret = fd_ctx_set (file, this, (uint64_t)(unsigned long)ctx); if (ret < 0) { if (loc) - gf_log (this->name, GF_LOG_WARNING, + gf_msg (this->name, GF_LOG_WARNING, 0, + PC_MSG_FD_SET_FAIL, "%s (%s): failed to set remote fd", loc->path, uuid_utoa (loc->inode->gfid)); else - gf_log (this->name, GF_LOG_WARNING, + gf_msg (this->name, GF_LOG_WARNING, 0, + PC_MSG_FD_SET_FAIL, "%p: failed to set remote fd", file); } out: @@ -225,9 +230,9 @@ unserialize_rsp_direntp (xlator_t *this, fd_t *fd, ret = dict_unserialize (buf, trav->dict.dict_len, &entry->dict); if (ret < 0) { - gf_log (THIS->name, GF_LOG_WARNING, + gf_msg (THIS->name, GF_LOG_WARNING, EINVAL, + PC_MSG_DICT_UNSERIALIZE_FAIL, "failed to unserialize xattr dict"); - errno = EINVAL; goto out; } entry->dict->extra_free = buf; -- cgit