summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-helpers.c
diff options
context:
space:
mode:
authoryatip <ypadia@redhat.com>2020-02-03 17:36:00 +0530
committerAmar Tumballi <amar@kadalu.io>2020-03-03 11:56:44 +0000
commit48245df36c5dec40779355a36d7bb7689f9efe6d (patch)
tree1eeda3ac005002343d1e201849ed6e75ee03afb4 /xlators/protocol/client/src/client-helpers.c
parent1291667e26516d02e548207ba3df84c456a36b35 (diff)
protocol/client: structure logging
convert gf_msg() to gf_smsg() Updates: #657 Change-Id: I76a09cfd283bb4ec5c4358536da66547aaf0de31 Signed-off-by: yatip <ypadia@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client-helpers.c')
-rw-r--r--xlators/protocol/client/src/client-helpers.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c
index e49647faa6f..189dfddd021 100644
--- a/xlators/protocol/client/src/client-helpers.c
+++ b/xlators/protocol/client/src/client-helpers.c
@@ -91,23 +91,23 @@ 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_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));
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_FD_DUPLICATE_TRY,
+ "path=%s", loc->path, "gfid=%s",
+ uuid_utoa(loc->inode->gfid), NULL);
else
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_FD_DUPLICATE_TRY,
- "%p: trying duplicate remote fd set. ", file);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_FD_DUPLICATE_TRY,
+ "file=%p", file, NULL);
}
ret = fd_ctx_set(file, this, (uint64_t)(unsigned long)ctx);
if (ret < 0) {
if (loc)
- 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));
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FD_SET_FAIL,
+ "path=%s", loc->path, "gfid=%s",
+ uuid_utoa(loc->inode->gfid), NULL);
else
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FD_SET_FAIL,
- "%p: failed to set remote fd", file);
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FD_SET_FAIL,
+ "file=%p", file, NULL);
}
out:
return;
@@ -213,9 +213,8 @@ unserialize_rsp_direntp(xlator_t *this, fd_t *fd, struct gfs3_readdirp_rsp *rsp,
ret = dict_unserialize(trav->dict.dict_val, trav->dict.dict_len,
&entry->dict);
if (ret < 0) {
- gf_msg(THIS->name, GF_LOG_WARNING, EINVAL,
- PC_MSG_DICT_UNSERIALIZE_FAIL,
- "failed to unserialize xattr dict");
+ gf_smsg(THIS->name, GF_LOG_WARNING, EINVAL,
+ PC_MSG_DICT_UNSERIALIZE_FAIL, "xattr", NULL);
goto out;
}
}
@@ -538,7 +537,7 @@ clnt_unserialize_rsp_locklist(xlator_t *this, struct gfs3_getactivelk_rsp *rsp,
while (trav) {
temp = GF_CALLOC(1, sizeof(*lmi), gf_common_mt_lock_mig);
if (temp == NULL) {
- gf_msg(this->name, GF_LOG_ERROR, 0, 0, "No memory");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_NO_MEM, NULL);
goto out;
}
@@ -578,7 +577,7 @@ clnt_unserialize_rsp_locklist_v2(xlator_t *this,
while (trav) {
temp = GF_CALLOC(1, sizeof(*lmi), gf_common_mt_lock_mig);
if (temp == NULL) {
- gf_msg(this->name, GF_LOG_ERROR, 0, 0, "No memory");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_NO_MEM, NULL);
goto out;
}
@@ -662,8 +661,8 @@ serialize_req_locklist(lock_migration_info_t *locklist,
break;
default:
- gf_msg(THIS->name, GF_LOG_ERROR, 0, 0,
- "Unknown lock type: %" PRId32 "!", tmp->flock.l_type);
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PC_MSG_UNKNOWN_LOCK_TYPE,
+ "type=%" PRId32, tmp->flock.l_type, NULL);
break;
}
@@ -673,8 +672,8 @@ serialize_req_locklist(lock_migration_info_t *locklist,
trav->client_uid = gf_strdup(tmp->client_uid);
if (!trav->client_uid) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, 0,
- "client_uid could not be allocated");
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PC_MSG_CLIENT_UID_ALLOC_FAILED,
+ NULL);
ret = -1;
goto out;
}
@@ -725,8 +724,8 @@ serialize_req_locklist_v2(lock_migration_info_t *locklist,
break;
default:
- gf_msg(THIS->name, GF_LOG_ERROR, 0, 0,
- "Unknown lock type: %" PRId32 "!", tmp->flock.l_type);
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PC_MSG_UNKNOWN_LOCK_TYPE,
+ "type=%" PRId32, tmp->flock.l_type, NULL);
break;
}
@@ -736,8 +735,8 @@ serialize_req_locklist_v2(lock_migration_info_t *locklist,
trav->client_uid = gf_strdup(tmp->client_uid);
if (!trav->client_uid) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, 0,
- "client_uid could not be allocated");
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PC_MSG_CLIENT_UID_ALLOC_FAILED,
+ NULL);
ret = -1;
goto out;
}