summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorManikandan Selvaganesh <mselvaga@redhat.com>2015-08-12 15:29:31 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-08-31 02:45:09 -0700
commit713f59cc197d86c5048e5cab2d3d3ae502634ed7 (patch)
treea285ae38a006e676a9263490ad7b0622e8751f65 /xlators/protocol
parentf0afc2e7c7bee3043ac1e7d098bc44db60186856 (diff)
protocol/server : porting missing gf_log's to gf_msg
Backport of http://review.gluster.org/#/c/11895/ Cherry-picked form commit a26dbb38acdb2ec5fe16068caee189709faae76e > Change-Id: I8818931fafea3c013551a5de23a9f77c81164841 > BUG: 1252808 > Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> > Reviewed-on: http://review.gluster.org/11895 > Tested-by: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: I8818931fafea3c013551a5de23a9f77c81164841 BUG: 1257193 Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/12018 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>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/server/src/server-messages.h48
-rw-r--r--xlators/protocol/server/src/server-rpc-fops.c8
-rw-r--r--xlators/protocol/server/src/server.c26
3 files changed, 69 insertions, 13 deletions
diff --git a/xlators/protocol/server/src/server-messages.h b/xlators/protocol/server/src/server-messages.h
index f604086821f..cd26fbb0203 100644
--- a/xlators/protocol/server/src/server-messages.h
+++ b/xlators/protocol/server/src/server-messages.h
@@ -45,7 +45,7 @@
*/
#define GLFS_PS_BASE GLFS_MSGID_COMP_PS
-#define GLFS_NUM_MESSAGES 82
+#define GLFS_NUM_MESSAGES 88
#define GLFS_MSGID_END (GLFS_PS_BASE + GLFS_NUM_MESSAGES + 1)
/* Messages with message IDs */
#define glfs_msg_start_x GLFS_PS_BASE, "Invalid: Start of messages"
@@ -789,6 +789,52 @@
*
*/
+#define PS_MSG_GRACE_TIMER_CANCELLED (GLFS_PS_BASE + 83)
+
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
+
+#define PS_MSG_ENCODE_MSG_FAILED (GLFS_PS_BASE + 84)
+
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
+
+#define PS_MSG_REPLY_SUBMIT_FAILED (GLFS_PS_BASE + 85)
+
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
+
+#define PS_MSG_RPC_NOTIFY_ERROR (GLFS_PS_BASE + 86)
+
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
+
+#define PS_MSG_SERVER_EVENT_UPCALL_FAILED (GLFS_PS_BASE + 87)
+
+/*!
+ * @messageid
+ * @diagnosis
+ * @recommendedaction
+ *
+ */
+
+#define PS_MSG_SERVER_IPC_INFO (GLFS_PS_BASE + 88)
/*------------*/
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
index d750a640655..e50284a06eb 100644
--- a/xlators/protocol/server/src/server-rpc-fops.c
+++ b/xlators/protocol/server/src/server-rpc-fops.c
@@ -2097,11 +2097,11 @@ server_ipc_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
rsp.xdata.xdata_len, op_errno, out);
if (op_ret) {
- gf_log (this->name, GF_LOG_INFO,
- "%"PRId64": IPC%"PRId64" (%s) ==> (%s)",
+ gf_msg (this->name, GF_LOG_INFO, op_errno,
+ PS_MSG_SERVER_IPC_INFO,
+ "%"PRId64": IPC%"PRId64" (%s)",
frame->root->unique, state->resolve.fd_no,
- uuid_utoa (state->resolve.gfid),
- strerror (op_errno));
+ uuid_utoa (state->resolve.gfid));
goto out;
}
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 9ddd045c765..619290643f3 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -107,7 +107,8 @@ gfs_serialize_reply (rpcsvc_request_t *req, void *arg, struct iovec *outmsg,
xdr_size = xdr_sizeof (xdrproc, arg);
iob = iobuf_get2 (req->svc->ctx->iobuf_pool, xdr_size);
if (!iob) {
- gf_log_callingfn (THIS->name, GF_LOG_ERROR,
+ gf_msg_callingfn (THIS->name, GF_LOG_ERROR, ENOMEM,
+ PS_MSG_NO_MEMORY,
"Failed to get iobuf");
goto ret;
};
@@ -125,7 +126,9 @@ gfs_serialize_reply (rpcsvc_request_t *req, void *arg, struct iovec *outmsg,
/* Failed to Encode 'GlusterFS' msg in RPC is not exactly
failure of RPC return values.. client should get
notified about this, so there are no missing frames */
- gf_log_callingfn ("", GF_LOG_ERROR, "Failed to encode message");
+ gf_msg_callingfn ("", GF_LOG_ERROR, 0,
+ PS_MSG_ENCODE_MSG_FAILED,
+ "Failed to encode message");
req->rpc_err = GARBAGE_ARGS;
retlen = 0;
}
@@ -197,12 +200,15 @@ server_submit_reply (call_frame_t *frame, rpcsvc_request_t *req, void *arg,
*/
iobuf_unref (iob);
if (ret == -1) {
- gf_log_callingfn ("", GF_LOG_ERROR, "Reply submission failed");
+ gf_msg_callingfn ("", GF_LOG_ERROR, 0,
+ PS_MSG_REPLY_SUBMIT_FAILED,
+ "Reply submission failed");
if (frame && client && !lk_heal) {
server_connection_cleanup (frame->this, client,
INTERNAL_LOCKS | POSIX_LOCKS);
} else {
- gf_log_callingfn ("", GF_LOG_ERROR,
+ gf_msg_callingfn ("", GF_LOG_ERROR, 0,
+ PS_MSG_REPLY_SUBMIT_FAILED,
"Reply submission failed");
/* TODO: Failure of open(dir), create, inodelk, entrylk
or lk fops send failure must be handled specially. */
@@ -488,7 +494,8 @@ server_rpc_notify (rpcsvc_t *rpc, void *xl, rpcsvc_event_t event,
server_ctx_t *serv_ctx = NULL;
if (!xl || !data) {
- gf_log_callingfn ("server", GF_LOG_WARNING,
+ gf_msg_callingfn ("server", GF_LOG_WARNING, 0,
+ PS_MSG_RPC_NOTIFY_ERROR,
"Calling rpc_notify without initializing");
goto out;
}
@@ -729,7 +736,8 @@ reconfigure (xlator_t *this, dict_t *options)
conf = this->private;
if (!conf) {
- gf_log_callingfn (this->name, GF_LOG_DEBUG, "conf == null!!!");
+ gf_msg_callingfn (this->name, GF_LOG_DEBUG, EINVAL,
+ PS_MSG_INVALID_ENTRY, "conf == null!!!");
goto out;
}
@@ -1158,7 +1166,8 @@ server_process_event_upcall (xlator_t *this, void *data)
xdrproc = (xdrproc_t)xdr_gfs3_cbk_cache_invalidation_req;
break;
default:
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
+ PS_MSG_INVALID_ENTRY,
"Received invalid upcall event(%d)",
upcall_data->event_type);
goto out;
@@ -1211,7 +1220,8 @@ notify (xlator_t *this, int32_t event, void *data, ...)
ret = server_process_event_upcall (this, data);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ PS_MSG_SERVER_EVENT_UPCALL_FAILED,
"server_process_event_upcall failed");
goto out;
}