summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota/src/quotad-aggregator.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2015-05-25 16:52:10 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-06-14 21:29:01 -0700
commit8720cef1ed642d7cb09e98c41458d19845f24711 (patch)
tree4a0e3feca5d48a32f147a6a2a604c96ca9530b93 /xlators/features/quota/src/quotad-aggregator.c
parenta367d4c6965e1f0da36f17ab6c5fdbd37925ebdd (diff)
features/quota: port QUOTA messages to new logging framework
Change-Id: I5e3df8860ea35bce14a802391be9b22ad64f1ad4 BUG: 1075611 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: http://review.gluster.org/7574 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/quota/src/quotad-aggregator.c')
-rw-r--r--xlators/features/quota/src/quotad-aggregator.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/xlators/features/quota/src/quotad-aggregator.c b/xlators/features/quota/src/quotad-aggregator.c
index 6f2f6e8a7b0..6c9c40a122f 100644
--- a/xlators/features/quota/src/quotad-aggregator.c
+++ b/xlators/features/quota/src/quotad-aggregator.c
@@ -90,7 +90,8 @@ quotad_aggregator_submit_reply (call_frame_t *frame, rpcsvc_request_t *req,
iob = quotad_serialize_reply (req, arg, &rsp, xdrproc);
if (!iob) {
- gf_log ("", GF_LOG_ERROR, "Failed to serialize reply");
+ gf_msg ("", GF_LOG_ERROR, 0, Q_MSG_DICT_SERIALIZE_FAIL,
+ "Failed to serialize reply");
goto ret;
}
@@ -148,7 +149,9 @@ quotad_aggregator_getlimit_cbk (xlator_t *this, call_frame_t *frame,
out:
rsp->op_ret = ret;
if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "failed to unserialize "
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ Q_MSG_DICT_UNSERIALIZE_FAIL,
+ "failed to unserialize "
"nameless lookup rsp");
goto reply;
}
@@ -193,7 +196,8 @@ quotad_aggregator_getlimit (rpcsvc_request_t *req)
ret = xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf_cli_req);
if (ret < 0) {
//failed to decode msg;
- gf_log ("", GF_LOG_ERROR, "xdr decoding error");
+ gf_msg ("this->name", GF_LOG_ERROR, 0, Q_MSG_XDR_DECODE_ERROR,
+ "xdr decoding error");
req->rpc_err = GARBAGE_ARGS;
goto err;
}
@@ -203,8 +207,10 @@ quotad_aggregator_getlimit (rpcsvc_request_t *req)
ret = dict_unserialize (cli_req.dict.dict_val,
cli_req.dict.dict_len, &dict);
if (ret < 0) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to "
- "unserialize req-buffer to dictionary");
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ Q_MSG_DICT_UNSERIALIZE_FAIL,
+ "Failed to unserialize req-buffer to "
+ "dictionary");
goto err;
}
}
@@ -230,8 +236,8 @@ quotad_aggregator_getlimit (rpcsvc_request_t *req)
ret = dict_set_int32 (state->xdata, QUOTA_LIMIT_OBJECTS_KEY, 42);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to set "
- "QUOTA_LIMIT_OBJECTS_KEY");
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM, Q_MSG_ENOMEM,
+ "Failed to set QUOTA_LIMIT_OBJECTS_KEY");
goto err;
}
@@ -384,7 +390,8 @@ quotad_aggregator_init (xlator_t *this)
/* RPC related */
priv->rpcsvc = rpcsvc_init (this, this->ctx, this->options, 0);
if (priv->rpcsvc == NULL) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ Q_MSG_RPCSVC_INIT_FAILED,
"creation of rpcsvc failed");
ret = -1;
goto out;
@@ -393,7 +400,8 @@ quotad_aggregator_init (xlator_t *this)
ret = rpcsvc_create_listeners (priv->rpcsvc, this->options,
this->name);
if (ret < 1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ Q_MSG_RPCSVC_LISTENER_CREATION_FAILED,
"creation of listener failed");
ret = -1;
goto out;
@@ -404,7 +412,8 @@ quotad_aggregator_init (xlator_t *this)
ret = rpcsvc_program_register (priv->rpcsvc, &quotad_aggregator_prog);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ Q_MSG_RPCSVC_REGISTER_FAILED,
"registration of program (name:%s, prognum:%d, "
"progver:%d) failed", quotad_aggregator_prog.progname,
quotad_aggregator_prog.prognum,