summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-callback.c25
-rw-r--r--xlators/protocol/client/src/client-common.c30
-rw-r--r--xlators/protocol/client/src/client-handshake.c295
-rw-r--r--xlators/protocol/client/src/client-helpers.c45
-rw-r--r--xlators/protocol/client/src/client-lk.c29
-rw-r--r--xlators/protocol/client/src/client-messages.h121
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c624
-rw-r--r--xlators/protocol/client/src/client-rpc-fops_v2.c384
-rw-r--r--xlators/protocol/client/src/client.c131
-rw-r--r--xlators/protocol/client/src/client.h8
-rw-r--r--xlators/protocol/server/src/Makefile.am4
-rw-r--r--xlators/protocol/server/src/server-common.c2
-rw-r--r--xlators/protocol/server/src/server-helpers.c104
-rw-r--r--xlators/protocol/server/src/server-messages.h179
-rw-r--r--xlators/protocol/server/src/server-rpc-fops_v2.c736
-rw-r--r--xlators/protocol/server/src/server.c194
16 files changed, 1394 insertions, 1517 deletions
diff --git a/xlators/protocol/client/src/client-callback.c b/xlators/protocol/client/src/client-callback.c
index a5cc3d5cd35..d83d9c14899 100644
--- a/xlators/protocol/client/src/client-callback.c
+++ b/xlators/protocol/client/src/client-callback.c
@@ -16,24 +16,21 @@
static int
client_cbk_null(struct rpc_clnt *rpc, void *mydata, void *data)
{
- gf_msg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR,
- "this function should not be called");
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR, NULL);
return 0;
}
static int
client_cbk_fetchspec(struct rpc_clnt *rpc, void *mydata, void *data)
{
- gf_msg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR,
- "this function should not be called");
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR, NULL);
return 0;
}
static int
client_cbk_ino_flush(struct rpc_clnt *rpc, void *mydata, void *data)
{
- gf_msg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR,
- "this function should not be called");
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR, NULL);
return 0;
}
@@ -61,8 +58,8 @@ client_cbk_recall_lease(struct rpc_clnt *rpc, void *mydata, void *data)
(xdrproc_t)xdr_gfs3_recall_lease_req);
if (ret < 0) {
- gf_msg(THIS->name, GF_LOG_WARNING, -ret, PC_MSG_RECALL_LEASE_FAIL,
- "XDR decode of recall lease failed.");
+ gf_smsg(THIS->name, GF_LOG_WARNING, -ret, PC_MSG_RECALL_LEASE_FAIL,
+ NULL);
goto out;
}
@@ -113,8 +110,8 @@ client_cbk_cache_invalidation(struct rpc_clnt *rpc, void *mydata, void *data)
(xdrproc_t)xdr_gfs3_cbk_cache_invalidation_req);
if (ret < 0) {
- gf_msg(THIS->name, GF_LOG_WARNING, -ret, PC_MSG_CACHE_INVALIDATION_FAIL,
- "XDR decode of cache_invalidation failed.");
+ gf_smsg(THIS->name, GF_LOG_WARNING, -ret,
+ PC_MSG_CACHE_INVALIDATION_FAIL, NULL);
goto out;
}
@@ -205,8 +202,8 @@ client_cbk_inodelk_contention(struct rpc_clnt *rpc, void *mydata, void *data)
(xdrproc_t)xdr_gfs4_inodelk_contention_req);
if (ret < 0) {
- gf_msg(THIS->name, GF_LOG_WARNING, -ret, PC_MSG_INODELK_CONTENTION_FAIL,
- "XDR decode of inodelk contention failed.");
+ gf_smsg(THIS->name, GF_LOG_WARNING, -ret,
+ PC_MSG_INODELK_CONTENTION_FAIL, NULL);
goto out;
}
@@ -256,8 +253,8 @@ client_cbk_entrylk_contention(struct rpc_clnt *rpc, void *mydata, void *data)
(xdrproc_t)xdr_gfs4_entrylk_contention_req);
if (ret < 0) {
- gf_msg(THIS->name, GF_LOG_WARNING, -ret, PC_MSG_ENTRYLK_CONTENTION_FAIL,
- "XDR decode of entrylk contention failed.");
+ gf_smsg(THIS->name, GF_LOG_WARNING, -ret,
+ PC_MSG_ENTRYLK_CONTENTION_FAIL, NULL);
goto out;
}
diff --git a/xlators/protocol/client/src/client-common.c b/xlators/protocol/client/src/client-common.c
index 64db98d661b..c112820e407 100644
--- a/xlators/protocol/client/src/client-common.c
+++ b/xlators/protocol/client/src/client-common.c
@@ -449,7 +449,8 @@ client_pre_fsync(xlator_t *this, gfs3_fsync_req *req, fd_t *fd, int32_t flags,
int64_t remote_fd = -1;
int op_errno = 0;
- CLIENT_GET_REMOTE_FD(this, fd, DEFAULT_REMOTE_FD, remote_fd, op_errno, out);
+ CLIENT_GET_REMOTE_FD(this, fd, FALLBACK_TO_ANON_FD, remote_fd, op_errno,
+ out);
req->fd = remote_fd;
req->data = flags;
@@ -714,8 +715,8 @@ client_pre_lk(xlator_t *this, gfs3_lk_req *req, int32_t cmd,
ret = client_cmd_to_gf_cmd(cmd, &gf_cmd);
if (ret) {
op_errno = EINVAL;
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_UNKNOWN_CMD,
+ "gf_cmd=%d", gf_cmd, NULL);
goto out;
}
@@ -827,8 +828,8 @@ client_pre_inodelk(xlator_t *this, gfs3_inodelk_req *req, loc_t *loc, int cmd,
else if (cmd == F_SETLKW || cmd == F_SETLKW64)
gf_cmd = GF_LK_SETLKW;
else {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_UNKNOWN_CMD,
+ "gf_cmd=%d", gf_cmd, NULL);
op_errno = EINVAL;
goto out;
}
@@ -877,8 +878,8 @@ client_pre_finodelk(xlator_t *this, gfs3_finodelk_req *req, fd_t *fd, int cmd,
else if (cmd == F_SETLKW || cmd == F_SETLKW64)
gf_cmd = GF_LK_SETLKW;
else {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_UNKNOWN_CMD,
+ "gf_cmd=%d", gf_cmd, NULL);
goto out;
}
@@ -2641,7 +2642,8 @@ client_pre_fsync_v2(xlator_t *this, gfx_fsync_req *req, fd_t *fd, int32_t flags,
int64_t remote_fd = -1;
int op_errno = 0;
- CLIENT_GET_REMOTE_FD(this, fd, DEFAULT_REMOTE_FD, remote_fd, op_errno, out);
+ CLIENT_GET_REMOTE_FD(this, fd, FALLBACK_TO_ANON_FD, remote_fd, op_errno,
+ out);
req->fd = remote_fd;
req->data = flags;
@@ -2895,8 +2897,8 @@ client_pre_lk_v2(xlator_t *this, gfx_lk_req *req, int32_t cmd,
ret = client_cmd_to_gf_cmd(cmd, &gf_cmd);
if (ret) {
op_errno = EINVAL;
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_UNKNOWN_CMD,
+ "gf_cmd=%d", gf_cmd, NULL);
goto out;
}
@@ -3005,8 +3007,8 @@ client_pre_inodelk_v2(xlator_t *this, gfx_inodelk_req *req, loc_t *loc, int cmd,
else if (cmd == F_SETLKW || cmd == F_SETLKW64)
gf_cmd = GF_LK_SETLKW;
else {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_UNKNOWN_CMD,
+ "gf_cmd=%d", gf_cmd, NULL);
op_errno = EINVAL;
goto out;
}
@@ -3055,8 +3057,8 @@ client_pre_finodelk_v2(xlator_t *this, gfx_finodelk_req *req, fd_t *fd, int cmd,
else if (cmd == F_SETLKW || cmd == F_SETLKW64)
gf_cmd = GF_LK_SETLKW;
else {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_UNKNOWN_CMD,
+ "gf_cmd=%d", gf_cmd, NULL);
goto out;
}
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index f0c5bc86cfd..ea5ef5c1800 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -47,14 +47,12 @@ client_notify_parents_child_up(xlator_t *this)
if (conf->child_up) {
ret = client_notify_dispatch_uniq(this, GF_EVENT_CHILD_UP, NULL);
if (ret) {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_UP_NOTIFY_FAILED,
- "notify of CHILD_UP failed");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_UP_NOTIFY_FAILED,
+ NULL);
goto out;
}
} else {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_STATUS,
- "Defering sending CHILD_UP message as the client "
- "translators are not yet ready to serve.");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_STATUS, NULL);
}
out:
@@ -104,8 +102,7 @@ client_child_up_reopen_done(clnt_fd_ctx_t *fdctx, int64_t rfd, xlator_t *this)
client_reopen_done(fdctx, rfd, this);
if (fd_count == 0) {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_UP_NOTIFY,
- "last fd open'd - notifying CHILD-UP");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_UP_NOTIFY, NULL);
client_notify_parents_child_up(this);
}
}
@@ -124,10 +121,8 @@ client3_3_reopen_cbk(struct rpc_req *req, struct iovec *iov, int count,
clnt_fd_ctx_t *fdctx = local->fdctx;
if (-1 == req->rpc_status) {
- gf_msg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
- PC_MSG_RPC_STATUS_ERROR,
- "received RPC status error, "
- "returning ENOTCONN");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
+ PC_MSG_RPC_STATUS_ERROR, NULL);
rsp.op_ret = -1;
rsp.op_errno = ENOTCONN;
goto out;
@@ -135,16 +130,16 @@ client3_3_reopen_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_open_rsp);
if (ret < 0) {
- gf_msg(frame->this->name, GF_LOG_ERROR, EINVAL,
- PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
+ gf_smsg(frame->this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
}
if (rsp.op_ret < 0) {
- gf_msg(frame->this->name, GF_LOG_WARNING, rsp.op_errno,
- PC_MSG_DIR_OP_SUCCESS, "reopen on %s failed.", local->loc.path);
+ gf_smsg(frame->this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REOPEN_FAILED, "path=%s", local->loc.path);
} else {
gf_msg_debug(frame->this->name, 0,
"reopen on %s succeeded (remote-fd = %" PRId64 ")",
@@ -179,10 +174,8 @@ client3_3_reopendir_cbk(struct rpc_req *req, struct iovec *iov, int count,
clnt_fd_ctx_t *fdctx = local->fdctx;
if (-1 == req->rpc_status) {
- gf_msg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
- PC_MSG_RPC_STATUS_ERROR,
- "received RPC status error, "
- "returning ENOTCONN");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
+ PC_MSG_RPC_STATUS_ERROR, NULL);
rsp.op_ret = -1;
rsp.op_errno = ENOTCONN;
goto out;
@@ -190,21 +183,19 @@ client3_3_reopendir_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_opendir_rsp);
if (ret < 0) {
- gf_msg(frame->this->name, GF_LOG_ERROR, EINVAL,
- PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
+ gf_smsg(frame->this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
}
if (rsp.op_ret < 0) {
- gf_msg(frame->this->name, GF_LOG_WARNING, rsp.op_errno,
- PC_MSG_DIR_OP_FAILED, "reopendir on %s failed", local->loc.path);
+ gf_smsg(frame->this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REOPEN_FAILED, "path=%s", local->loc.path, NULL);
} else {
- gf_msg(frame->this->name, GF_LOG_INFO, 0, PC_MSG_DIR_OP_SUCCESS,
- "reopendir on %s succeeded "
- "(fd = %" PRId64 ")",
- local->loc.path, rsp.fd);
+ gf_smsg(frame->this->name, GF_LOG_INFO, 0, PC_MSG_DIR_OP_SUCCESS,
+ "path=%s", local->loc.path, "fd=%" PRId64, rsp.fd, NULL);
}
if (-1 == rsp.op_ret) {
@@ -263,8 +254,7 @@ protocol_client_reopendir(clnt_fd_ctx_t *fdctx, xlator_t *this)
client3_3_reopendir_cbk, NULL,
(xdrproc_t)xdr_gfs3_opendir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED,
- "failed to send the re-opendir request");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED, NULL);
}
return 0;
@@ -322,8 +312,7 @@ protocol_client_reopenfile(clnt_fd_ctx_t *fdctx, xlator_t *this)
client3_3_reopen_cbk, NULL,
(xdrproc_t)xdr_gfs3_open_req);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED,
- "failed to send the re-open request");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED, NULL);
}
return 0;
@@ -366,10 +355,8 @@ client4_0_reopen_cbk(struct rpc_req *req, struct iovec *iov, int count,
clnt_fd_ctx_t *fdctx = local->fdctx;
if (-1 == req->rpc_status) {
- gf_msg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
- PC_MSG_RPC_STATUS_ERROR,
- "received RPC status error, "
- "returning ENOTCONN");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
+ PC_MSG_RPC_STATUS_ERROR, NULL);
rsp.op_ret = -1;
rsp.op_errno = ENOTCONN;
goto out;
@@ -377,16 +364,16 @@ client4_0_reopen_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_open_rsp);
if (ret < 0) {
- gf_msg(frame->this->name, GF_LOG_ERROR, EINVAL,
- PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
+ gf_smsg(frame->this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
}
if (rsp.op_ret < 0) {
- gf_msg(frame->this->name, GF_LOG_WARNING, rsp.op_errno,
- PC_MSG_DIR_OP_SUCCESS, "reopen on %s failed.", local->loc.path);
+ gf_smsg(frame->this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REOPEN_FAILED, "path=%s", local->loc.path, NULL);
} else {
gf_msg_debug(frame->this->name, 0,
"reopen on %s succeeded (remote-fd = %" PRId64 ")",
@@ -421,10 +408,8 @@ client4_0_reopendir_cbk(struct rpc_req *req, struct iovec *iov, int count,
clnt_fd_ctx_t *fdctx = local->fdctx;
if (-1 == req->rpc_status) {
- gf_msg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
- PC_MSG_RPC_STATUS_ERROR,
- "received RPC status error, "
- "returning ENOTCONN");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
+ PC_MSG_RPC_STATUS_ERROR, NULL);
rsp.op_ret = -1;
rsp.op_errno = ENOTCONN;
goto out;
@@ -432,21 +417,19 @@ client4_0_reopendir_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_open_rsp);
if (ret < 0) {
- gf_msg(frame->this->name, GF_LOG_ERROR, EINVAL,
- PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
+ gf_smsg(frame->this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
}
if (rsp.op_ret < 0) {
- gf_msg(frame->this->name, GF_LOG_WARNING, rsp.op_errno,
- PC_MSG_DIR_OP_FAILED, "reopendir on %s failed", local->loc.path);
+ gf_smsg(frame->this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_DIR_OP_FAILED, "dir-path=%s", local->loc.path, NULL);
} else {
- gf_msg(frame->this->name, GF_LOG_INFO, 0, PC_MSG_DIR_OP_SUCCESS,
- "reopendir on %s succeeded "
- "(fd = %" PRId64 ")",
- local->loc.path, rsp.fd);
+ gf_smsg(frame->this->name, GF_LOG_INFO, 0, PC_MSG_DIR_OP_SUCCESS,
+ "path=%s", local->loc.path, "fd=%" PRId64, rsp.fd, NULL);
}
if (-1 == rsp.op_ret) {
@@ -504,8 +487,7 @@ protocol_client_reopendir_v2(clnt_fd_ctx_t *fdctx, xlator_t *this)
client4_0_reopendir_cbk, NULL,
(xdrproc_t)xdr_gfx_opendir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED,
- "failed to send the re-opendir request");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED, NULL);
}
return 0;
@@ -562,8 +544,7 @@ protocol_client_reopenfile_v2(clnt_fd_ctx_t *fdctx, xlator_t *this)
client4_0_reopen_cbk, NULL,
(xdrproc_t)xdr_gfx_open_req);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED,
- "failed to send the re-open request");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED, NULL);
}
return 0;
@@ -677,10 +658,8 @@ client_post_handshake(call_frame_t *frame, xlator_t *this)
/* Delay notifying CHILD_UP to parents
until all locks are recovered */
if (count > 0) {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_UP_NOTIFY_DELAY,
- "%d fds open - Delaying "
- "child_up until they are re-opened",
- count);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_UP_NOTIFY_DELAY,
+ "count=%d", count, NULL);
client_save_number_fds(conf, count);
list_for_each_entry_safe(fdctx, tmp, &reopen_head, sfd_pos)
@@ -728,24 +707,24 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count,
GF_VALIDATE_OR_GOTO(this->name, ctx, out);
if (-1 == req->rpc_status) {
- gf_msg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
- PC_MSG_RPC_STATUS_ERROR, "received RPC status error");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
+ PC_MSG_RPC_STATUS_ERROR, NULL);
op_ret = -1;
goto out;
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_setvolume_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
op_ret = -1;
goto out;
}
op_ret = rsp.op_ret;
op_errno = gf_error_to_errno(rsp.op_errno);
if (-1 == rsp.op_ret) {
- gf_msg(frame->this->name, GF_LOG_WARNING, op_errno, PC_MSG_VOL_SET_FAIL,
- "failed to set the volume");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, op_errno,
+ PC_MSG_VOL_SET_FAIL, NULL);
}
reply = dict_new();
@@ -755,31 +734,27 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count,
if (rsp.dict.dict_len) {
ret = dict_unserialize(rsp.dict.dict_val, rsp.dict.dict_len, &reply);
if (ret < 0) {
- gf_msg(frame->this->name, GF_LOG_WARNING, 0,
- PC_MSG_DICT_UNSERIALIZE_FAIL,
- "failed to "
- "unserialize buffer to dict");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, 0,
+ PC_MSG_DICT_UNSERIALIZE_FAIL, NULL);
goto out;
}
}
ret = dict_get_str_sizen(reply, "ERROR", &remote_error);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_DICT_GET_FAILED,
- "failed to get ERROR "
- "string from reply dict");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_DICT_GET_FAILED,
+ "ERROR string", NULL);
}
ret = dict_get_str_sizen(reply, "process-uuid", &process_uuid);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_DICT_GET_FAILED,
- "failed to get "
- "'process-uuid' from reply dict");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_DICT_GET_FAILED,
+ "process-uuid", NULL);
}
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, op_errno, PC_MSG_SETVOLUME_FAIL,
- "SETVOLUME on remote-host failed: %s", remote_error);
+ gf_smsg(this->name, GF_LOG_ERROR, op_errno, PC_MSG_SETVOLUME_FAIL,
+ "remote-error=%s", remote_error, NULL);
errno = op_errno;
if (remote_error && (op_errno == EACCES)) {
@@ -799,16 +774,16 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count,
if (op_errno == ESTALE) {
ret = client_notify_dispatch(this, GF_EVENT_VOLFILE_MODIFIED, NULL);
if (ret)
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_VOLFILE_NOTIFY_FAILED,
- "notify of VOLFILE_MODIFIED failed");
+ gf_smsg(this->name, GF_LOG_INFO, 0,
+ PC_MSG_VOLFILE_NOTIFY_FAILED, NULL);
}
goto out;
}
ret = dict_get_str_sizen(this->options, "remote-subvolume", &remote_subvol);
if (ret || !remote_subvol) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_GET_FAILED,
- "failed to find key 'remote-subvolume' in the options");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FIND_KEY_FAILED,
+ "remote-subvolume", NULL);
goto out;
}
@@ -827,10 +802,9 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count,
if (strcmp(ctx->volume_id, volume_id)) {
/* Ideally it shouldn't even come here, as server itself
should fail the handshake in that case */
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_DICT_GET_FAILED,
- "'volume-id' changed, can't connect to server. "
- "Needs remount (%s - %s)",
- volume_id, ctx->volume_id);
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_VOL_ID_CHANGED,
+ "vol-id=%s", volume_id, "ctx->vol-id=%s",
+ ctx->volume_id, NULL);
op_ret = -1;
goto out;
}
@@ -847,8 +821,8 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count,
* connect to this client is running an older version. Hence *
* setting the child_up to _gf_true in this case. *
*/
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_GET_FAILED,
- "failed to find key 'child_up' in the options");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FIND_KEY_FAILED,
+ "child_up", NULL);
conf->child_up = _gf_true;
} else {
conf->child_up = (child_up_int != 0);
@@ -878,9 +852,9 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count,
conf->client_id = glusterfs_leaf_position(this);
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_REMOTE_VOL_CONNECTED,
- "Connected to %s, attached to remote volume '%s'.",
- conf->rpc->conn.name, remote_subvol);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_REMOTE_VOL_CONNECTED,
+ "conn-name=%s", conf->rpc->conn.name, "remote_subvol=%s",
+ remote_subvol, NULL);
op_ret = 0;
conf->connected = 1;
@@ -888,13 +862,11 @@ client_setvolume_cbk(struct rpc_req *req, struct iovec *iov, int count,
client_post_handshake(frame, frame->this);
out:
if (auth_fail) {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_AUTH_FAILED,
- "sending AUTH_FAILED event");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_AUTH_FAILED, NULL);
ret = client_notify_dispatch(this, GF_EVENT_AUTH_FAILED, NULL);
if (ret)
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_AUTH_FAILED_NOTIFY_FAILED,
- "notify of "
- "AUTH_FAILED failed");
+ gf_smsg(this->name, GF_LOG_INFO, 0,
+ PC_MSG_AUTH_FAILED_NOTIFY_FAILED, NULL);
conf->connected = 0;
ret = -1;
}
@@ -903,14 +875,12 @@ out:
* background, for now, don't hang here,
* tell the parents that i am all ok..
*/
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_CONNECTING_EVENT,
- "sending "
- "CHILD_CONNECTING event");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_CONNECTING_EVENT,
+ NULL);
ret = client_notify_dispatch(this, GF_EVENT_CHILD_CONNECTING, NULL);
if (ret)
- gf_msg(this->name, GF_LOG_INFO, 0,
- PC_MSG_CHILD_CONNECTING_NOTIFY_FAILED,
- "notify of CHILD_CONNECTING failed");
+ gf_smsg(this->name, GF_LOG_INFO, 0,
+ PC_MSG_CHILD_CONNECTING_NOTIFY_FAILED, NULL);
/*
* The reconnection *won't* happen in the background (see
* previous comment) unless we kill the current connection.
@@ -952,10 +922,8 @@ client_setvolume(xlator_t *this, struct rpc_clnt *rpc)
ret = dict_set_int32_sizen(options, "fops-version",
conf->fops->prognum);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set "
- "version-fops(%d) in handshake msg",
- conf->fops->prognum);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
+ "version-fops=%d", conf->fops->prognum, NULL);
goto fail;
}
}
@@ -964,10 +932,8 @@ client_setvolume(xlator_t *this, struct rpc_clnt *rpc)
ret = dict_set_int32_sizen(options, "mgmt-version",
conf->mgmt->prognum);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set "
- "version-mgmt(%d) in handshake msg",
- conf->mgmt->prognum);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
+ "version-mgmt=%d", conf->mgmt->prognum, NULL);
goto fail;
}
}
@@ -983,8 +949,8 @@ client_setvolume(xlator_t *this, struct rpc_clnt *rpc)
conf->setvol_count++;
if (gethostname(hostname, 256) == -1) {
- gf_msg(this->name, GF_LOG_ERROR, errno, LG_MSG_GETHOSTNAME_FAILED,
- "gethostname: failed");
+ gf_smsg(this->name, GF_LOG_ERROR, errno, PC_MSG_GETHOSTNAME_FAILED,
+ NULL);
goto fail;
}
@@ -993,17 +959,15 @@ client_setvolume(xlator_t *this, struct rpc_clnt *rpc)
this->ctx->process_uuid, this->graph->id, getpid(),
hostname, this->name, counter_str);
if (-1 == ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_PROCESS_UUID_SET_FAIL,
- "asprintf failed while "
- "setting process_uuid");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_PROCESS_UUID_SET_FAIL,
+ NULL);
goto fail;
}
ret = dict_set_dynstr_sizen(options, "process-uuid", process_uuid_xl);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set process-uuid(%s) in handshake msg",
- process_uuid_xl);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
+ "process-uuid=%s", process_uuid_xl, NULL);
goto fail;
}
@@ -1011,22 +975,21 @@ client_setvolume(xlator_t *this, struct rpc_clnt *rpc)
ret = dict_set_str_sizen(options, "process-name",
this->ctx->cmd_args.process_name);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set process-name in handshake msg");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_DICT_SET_FAILED,
+ "process-name", NULL);
}
}
ret = dict_set_str_sizen(options, "client-version", PACKAGE_VERSION);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set client-version(%s) in handshake msg",
- PACKAGE_VERSION);
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
+ "client-version=%s", PACKAGE_VERSION, NULL);
}
ret = dict_get_str_sizen(this->options, "remote-subvolume", &remote_subvol);
if (ret || !remote_subvol) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_GET_FAILED,
- "failed to find key 'remote-subvolume' in the options");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FIND_KEY_FAILED,
+ "remote-subvolume", NULL);
goto fail;
}
@@ -1041,8 +1004,8 @@ client_setvolume(xlator_t *this, struct rpc_clnt *rpc)
if (this->ctx->volume_id[0]) {
ret = dict_set_str(options, "volume-id", this->ctx->volume_id);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set volume-id in handshake msg");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_DICT_SET_FAILED,
+ "volume-id", NULL);
}
}
}
@@ -1052,16 +1015,14 @@ client_setvolume(xlator_t *this, struct rpc_clnt *rpc)
ret = dict_set_str_sizen(options, "volfile-key",
this->ctx->cmd_args.volfile_id);
if (ret)
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
- "failed to "
- "set 'volfile-key'");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PC_MSG_VOLFILE_KEY_SET_FAILED, NULL);
}
ret = dict_set_uint32(options, "volfile-checksum",
this->graph->volfile_checksum);
if (ret)
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set "
- "'volfile-checksum'");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_VOLFILE_CHECKSUM_FAILED,
+ NULL);
}
if (this->ctx->cmd_args.subdir_mount) {
@@ -1080,23 +1041,21 @@ client_setvolume(xlator_t *this, struct rpc_clnt *rpc)
*/
ret = dict_set_uint32(options, "clnt-lk-version", 1);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set clnt-lk-version(1) in handshake msg");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
+ "clnt-lk-version(1)", NULL);
}
ret = dict_set_int32_sizen(options, "opversion", GD_OP_VERSION_MAX);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
- "Failed to set client opversion in handshake message");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
+ "client opversion", NULL);
}
ret = dict_allocate_and_serialize(options, (char **)&req.dict.dict_val,
&req.dict.dict_len);
if (ret != 0) {
ret = -1;
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SERIALIZE_FAIL,
- "failed to serialize "
- "dictionary");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SERIALIZE_FAIL, NULL);
goto fail;
}
@@ -1122,8 +1081,7 @@ select_server_supported_programs(xlator_t *this, gf_prog_detail *prog)
int ret = -1;
if (!this || !prog) {
- gf_msg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_PGM_NOT_FOUND,
- "xlator not found OR RPC program not found");
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_PGM_NOT_FOUND, NULL);
goto out;
}
@@ -1165,10 +1123,9 @@ select_server_supported_programs(xlator_t *this, gf_prog_detail *prog)
done:
if (!ret)
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_VERSION_INFO,
- "Using Program %s,"
- " Num (%d), Version (%d)",
- conf->fops->progname, conf->fops->prognum, conf->fops->progver);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_VERSION_INFO,
+ "Program-name=%s", conf->fops->progname, "Num=%d",
+ conf->fops->prognum, "Version=%d", conf->fops->progver, NULL);
out:
return ret;
@@ -1181,8 +1138,7 @@ server_has_portmap(xlator_t *this, gf_prog_detail *prog)
int ret = -1;
if (!this || !prog) {
- gf_msg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_PGM_NOT_FOUND,
- "xlator not found OR RPC program not found");
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_PGM_NOT_FOUND, NULL);
goto out;
}
@@ -1219,36 +1175,30 @@ client_query_portmap_cbk(struct rpc_req *req, struct iovec *iov, int count,
frame = myframe;
if (!frame || !frame->this || !frame->this->private) {
- gf_msg(THIS->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "frame not found with rpc "
- "request");
+ gf_smsg(THIS->name, GF_LOG_WARNING, EINVAL, PC_MSG_FRAME_NOT_FOUND,
+ NULL);
goto out;
}
this = frame->this;
conf = frame->this->private;
if (-1 == req->rpc_status) {
- gf_msg(this->name, GF_LOG_WARNING, ENOTCONN, PC_MSG_RPC_STATUS_ERROR,
- "received RPC status error, "
- "try again later");
+ gf_smsg(this->name, GF_LOG_WARNING, ENOTCONN, PC_MSG_RPC_STATUS_ERROR,
+ NULL);
goto out;
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_pmap_port_by_brick_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
goto out;
}
if (-1 == rsp.op_ret) {
ret = -1;
if (!conf->portmap_err_logged) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_PORT_NUM_ERROR,
- "failed to get the "
- "port number for remote subvolume. Please run "
- "'gluster volume status' on server to see if "
- "brick process is running.");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_PORT_NUM_ERROR, NULL);
} else {
gf_msg_debug(this->name, 0,
"failed to get the port number for "
@@ -1300,8 +1250,8 @@ client_query_portmap(xlator_t *this, struct rpc_clnt *rpc)
ret = dict_get_str_sizen(options, "remote-subvolume", &remote_subvol);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_VOL_SET_FAIL,
- "remote-subvolume not set in volfile");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_REMOTE_SUBVOL_SET_FAIL,
+ NULL);
goto fail;
}
@@ -1345,21 +1295,20 @@ client_dump_version_cbk(struct rpc_req *req, struct iovec *iov, int count,
conf = frame->this->private;
if (-1 == req->rpc_status) {
- gf_msg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
- PC_MSG_RPC_STATUS_ERROR, "received RPC status error");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, ENOTCONN,
+ PC_MSG_RPC_STATUS_ERROR, NULL);
goto out;
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_dump_rsp);
if (ret < 0) {
- gf_msg(frame->this->name, GF_LOG_ERROR, EINVAL,
- PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
+ gf_smsg(frame->this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, NULL);
goto out;
}
if (-1 == rsp.op_ret) {
- gf_msg(frame->this->name, GF_LOG_WARNING, 0, PC_MSG_VERSION_ERROR,
- "failed to get the 'versions' "
- "from server");
+ gf_smsg(frame->this->name, GF_LOG_WARNING, 0, PC_MSG_VERSION_ERROR,
+ NULL);
goto out;
}
@@ -1372,9 +1321,7 @@ client_dump_version_cbk(struct rpc_req *req, struct iovec *iov, int count,
/* Reply in "Name:Program-Number:Program-Version,..." format */
ret = select_server_supported_programs(frame->this, rsp.prog);
if (ret) {
- gf_msg(frame->this->name, GF_LOG_ERROR, 0, PC_MSG_VERSION_ERROR,
- "server doesn't support the "
- "version");
+ gf_smsg(frame->this->name, GF_LOG_ERROR, 0, PC_MSG_VERSION_ERROR, NULL);
goto out;
}
@@ -1412,8 +1359,8 @@ client_handshake(xlator_t *this, struct rpc_clnt *rpc)
conf = this->private;
if (!conf->handshake) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_PGM_NOT_FOUND,
- "handshake program not found");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_HANDSHAKE_PGM_NOT_FOUND,
+ NULL);
goto out;
}
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;
}
diff --git a/xlators/protocol/client/src/client-lk.c b/xlators/protocol/client/src/client-lk.c
index c1fb055fc0e..795839734c5 100644
--- a/xlators/protocol/client/src/client-lk.c
+++ b/xlators/protocol/client/src/client-lk.c
@@ -24,14 +24,12 @@ __dump_client_lock(client_posix_lock_t *lock)
this = THIS;
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_CLIENT_LOCK_INFO,
- "{fd=%p}"
- "{%s lk-owner:%s %" PRId64 " - %" PRId64
- "}"
- "{start=%" PRId64 " end=%" PRId64 "}",
- lock->fd, lock->fl_type == F_WRLCK ? "Write-Lock" : "Read-Lock",
- lkowner_utoa(&lock->owner), lock->user_flock.l_start,
- lock->user_flock.l_len, lock->fl_start, lock->fl_end);
+ gf_smsg(
+ this->name, GF_LOG_INFO, 0, PC_MSG_CLIENT_LOCK_INFO, "fd=%p", lock->fd,
+ "fl_type=%s", lock->fl_type == F_WRLCK ? "Write-Lock" : "Read-Lock",
+ "lk-owner=%s", lkowner_utoa(&lock->owner), "l_start=%" PRId64,
+ lock->user_flock.l_start, "l_len=%" PRId64, lock->user_flock.l_len,
+ "start=%" PRId64, lock->fl_start, "end=%" PRId64, lock->fl_end, NULL);
}
static int
@@ -203,9 +201,7 @@ subtract_locks(client_posix_lock_t *big, client_posix_lock_t *small)
memcpy(v.locks[1], small, sizeof(client_posix_lock_t));
} else {
/* LOG-TODO : decide what more info is required here*/
- gf_msg("client-protocol", GF_LOG_CRITICAL, 0, PC_MSG_LOCK_ERROR,
- "Unexpected case in subtract_locks. Please send "
- "a bug report to gluster-devel@gluster.org");
+ gf_smsg("client-protocol", GF_LOG_CRITICAL, 0, PC_MSG_LOCK_ERROR, NULL);
}
return v;
@@ -343,8 +339,8 @@ delete_granted_locks_owner(fd_t *fd, gf_lkowner_t *owner)
if (!fdctx) {
pthread_spin_unlock(&conf->fd_lock);
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_FD_CTX_INVALID,
- "fdctx not valid");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_FD_CTX_INVALID,
+ NULL);
ret = -1;
goto out;
}
@@ -461,8 +457,7 @@ client_add_lock_for_recovery(fd_t *fd, struct gf_flock *flock,
if (!fdctx) {
pthread_spin_unlock(&conf->fd_lock);
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FD_GET_FAIL,
- "failed to get fd context. sending EBADFD");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FD_GET_FAIL, NULL);
ret = -EBADFD;
goto out;
}
@@ -498,8 +493,8 @@ client_dump_locks(char *name, inode_t *inode, dict_t *dict)
ret = dict_set_dynstr(new_dict, CLIENT_DUMP_LOCKS, dict_string);
if (ret) {
- gf_msg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
- "could not set dict with %s", CLIENT_DUMP_LOCKS);
+ gf_smsg(THIS->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAIL, "lock=%s",
+ CLIENT_DUMP_LOCKS, NULL);
goto out;
}
diff --git a/xlators/protocol/client/src/client-messages.h b/xlators/protocol/client/src/client-messages.h
index 1e9eaebb157..25a851d80b9 100644
--- a/xlators/protocol/client/src/client-messages.h
+++ b/xlators/protocol/client/src/client-messages.h
@@ -48,8 +48,127 @@ GLFS_MSGID(
PC_MSG_VERSION_ERROR, PC_MSG_DIR_OP_SUCCESS, PC_MSG_BAD_FD,
PC_MSG_CLIENT_LOCK_INFO, PC_MSG_CACHE_INVALIDATION_FAIL,
PC_MSG_CHILD_STATUS, PC_MSG_GFID_NULL, PC_MSG_RECALL_LEASE_FAIL,
- PC_MSG_INODELK_CONTENTION_FAIL, PC_MSG_ENTRYLK_CONTENTION_FAIL);
+ PC_MSG_INODELK_CONTENTION_FAIL, PC_MSG_ENTRYLK_CONTENTION_FAIL,
+ PC_MSG_BIGGER_SIZE, PC_MSG_CLIENT_DUMP_LOCKS_FAILED, PC_MSG_UNKNOWN_CMD,
+ PC_MSG_REOPEN_FAILED, PC_MSG_FIND_KEY_FAILED, PC_MSG_VOL_ID_CHANGED,
+ PC_MSG_GETHOSTNAME_FAILED, PC_MSG_VOLFILE_KEY_SET_FAILED,
+ PC_MSG_VOLFILE_CHECKSUM_FAILED, PC_MSG_FRAME_NOT_FOUND,
+ PC_MSG_REMOTE_SUBVOL_SET_FAIL, PC_MSG_HANDSHAKE_PGM_NOT_FOUND,
+ PC_MSG_MERGE_IOBREF_FAILED, PC_MSG_ADD_IOBUF_FAILED,
+ PC_MSG_RELEASE_DIR_OP_FAILED, PC_MSG_REMOTE_HOST_SET_FAILED,
+ PC_MSG_REMOTE_PORT_SET_FAILED, PC_MSG_REMOTE_HOST_NOT_SET,
+ PC_MSG_NOREMOTE_HOST, PC_MSG_REMOTE_SUBVOL_NOT_GIVEN,
+ PC_MSG_FATAL_CLIENT_PROTOCOL, PC_MSG_VOL_DANGLING,
+ PC_MSG_CREATE_MEM_POOL_FAILED, PC_MSG_PVT_XLATOR_NULL, PC_MSG_XLATOR_NULL,
+ PC_MSG_LEASE_FOP_FAILED, PC_MSG_DICT_SET_FAIL, PC_MSG_NO_MEM,
+ PC_MSG_UNKNOWN_LOCK_TYPE, PC_MSG_CLIENT_UID_ALLOC_FAILED);
#define PC_MSG_REMOTE_OP_FAILED_STR "remote operation failed."
+#define PC_MSG_XDR_DECODING_FAILED_STR "XDR decoding failed"
+#define PC_MSG_FOP_SEND_FAILED_STR "failed to send the fop"
+#define PC_MSG_BIGGER_SIZE_STR "read-size is bigger than iobuf isze"
+#define PC_MSG_CLIENT_DUMP_LOCKS_FAILED_STR "client dump locks failed"
+#define PC_MSG_UNKNOWN_CMD_STR "Unknown cmd"
+#define PC_MSG_CHILD_UP_NOTIFY_FAILED_STR "notify of CHILD_UP failed"
+#define PC_MSG_CHILD_STATUS_STR \
+ "Defering sending CHILD_UP message as the client translators are not yet " \
+ "ready to serve"
+#define PC_MSG_CHILD_UP_NOTIFY_STR "last fd open'd - notifying CHILD_UP"
+#define PC_MSG_RPC_STATUS_ERROR_STR \
+ "received RPC status error, returning ENOTCONN"
+#define PC_MSG_REOPEN_FAILED_STR "reopen failed"
+#define PC_MSG_DIR_OP_SUCCESS_STR "reopen dir succeeded"
+#define PC_MSG_DIR_OP_FAILED_STR "failed to send the re-opendir request"
+#define PC_MSG_CHILD_UP_NOTIFY_DELAY_STR \
+ "fds open - Delaying child_up until they are re-opened"
+#define PC_MSG_VOL_SET_FAIL_STR "failed to set the volume"
+#define PC_MSG_DICT_UNSERIALIZE_FAIL_STR "failed to unserialize buffer to dict"
+#define PC_MSG_DICT_GET_FAILED_STR "failed to get from reply dict"
+#define PC_MSG_SETVOLUME_FAIL_STR "SETVOLUME on remote-host failed"
+#define PC_MSG_VOLFILE_NOTIFY_FAILED_STR "notify of VOLFILE_MODIFIED failed"
+#define PC_MSG_FIND_KEY_FAILED_STR "failed to find key in the options"
+#define PC_MSG_VOL_ID_CHANGED_STR \
+ "volume-id changed, can't connect to server. Needs remount"
+#define PC_MSG_REMOTE_VOL_CONNECTED_STR "Connected, attached to remote volume"
+#define PC_MSG_AUTH_FAILED_STR "sending AUTH_FAILED event"
+#define PC_MSG_AUTH_FAILED_NOTIFY_FAILED_STR "notify of AUTH_FAILED failed"
+#define PC_MSG_CHILD_CONNECTING_EVENT_STR "sending CHILD_CONNECTING event"
+#define PC_MSG_CHILD_CONNECTING_NOTIFY_FAILED_STR \
+ "notify of CHILD_CONNECTING failed"
+#define PC_MSG_DICT_SET_FAILED_STR "failed to set in handshake msg"
+#define PC_MSG_GETHOSTNAME_FAILED_STR "gethostname: failed"
+#define PC_MSG_PROCESS_UUID_SET_FAIL_STR \
+ "asprintf failed while setting process_uuid"
+#define PC_MSG_VOLFILE_KEY_SET_FAILED_STR "failed to set volfile-key"
+#define PC_MSG_VOLFILE_CHECKSUM_FAILED_STR "failed to set volfile-checksum"
+#define PC_MSG_DICT_SERIALIZE_FAIL_STR "failed to serialize dictionary"
+#define PC_MSG_PGM_NOT_FOUND_STR "xlator not found OR RPC program not found"
+#define PC_MSG_VERSION_INFO_STR "Using Program"
+#define PC_MSG_FRAME_NOT_FOUND_STR "frame not found with rpc request"
+#define PC_MSG_PORT_NUM_ERROR_STR \
+ "failed to get the port number for remote subvolume. Please run gluster " \
+ "volume status on server to see if brick process is running"
+#define PC_MSG_REMOTE_SUBVOL_SET_FAIL_STR "remote-subvolume not set in volfile"
+#define PC_MSG_VERSION_ERROR_STR "failed to get the version from server"
+#define PC_MSG_NO_VERSION_SUPPORT_STR "server doesn't support the version"
+#define PC_MSG_HANDSHAKE_PGM_NOT_FOUND_STR "handshake program not found"
+#define PC_MSG_MERGE_IOBREF_FAILED_STR \
+ "cannot merge iobref passed from caller into new_iobref"
+#define PC_MSG_ADD_IOBUF_FAILED_STR "cannot add iobuf into iobref"
+#define PC_MSG_RELEASE_DIR_OP_FAILED_STR "release dir op failed"
+#define PC_MSG_FILE_OP_FAILED_STR "release fop failed"
+#define PC_MSG_REMOTE_HOST_SET_FAILED_STR "failed to set remote-host"
+#define PC_MSG_REMOTE_PORT_SET_FAILED_STR "failed to set remote-port"
+#define PC_MSG_RPC_INIT_STR "client rpc init command"
+#define PC_MSG_RPC_DESTROY_STR "client rpc destroy command"
+#define PC_MSG_HANDSHAKE_RETURN_STR "handshake msg returned"
+#define PC_MSG_CLIENT_DISCONNECTED_STR \
+ "disconnected from client, process will keep trying to connect glusterd " \
+ "until brick's port is available"
+#define PC_MSG_CHILD_DOWN_NOTIFY_FAILED_STR "CHILD_DOWN notify failed"
+#define PC_MSG_PARENT_UP_STR \
+ "parent translators are ready, attempting connect on transport"
+#define PC_MSG_PARENT_DOWN_STR \
+ "current graph is no longer active, destroying rpc_client"
+#define PC_MSG_REMOTE_HOST_NOT_SET_STR \
+ "Remote host is not set. Assuming the volfile server as remote host"
+#define PC_MSG_NOREMOTE_HOST_STR "No remote host to connect"
+#define PC_MSG_REMOTE_SUBVOL_NOT_GIVEN_STR "option 'remote-subvolume' not given"
+#define PC_MSG_NO_MEMORY_STR "Memory accounting init failed"
+#define PC_MSG_RPC_INVALID_CALL_STR \
+ "RPC destroy called on already destroyed connection"
+#define PC_MSG_RPC_INITED_ALREADY_STR "client rpc already init'ed"
+#define PC_MSG_RPC_INIT_FAILED_STR "failed to initialize RPC"
+#define PC_MSG_RPC_NOTIFY_FAILED_STR "failed to register notify"
+#define PC_MSG_RPC_CBK_FAILED_STR "failed to reister callback program"
+#define PC_MSG_FATAL_CLIENT_PROTOCOL_STR \
+ "FATAL: client protocol, translator cannot have any subvolumes"
+#define PC_MSG_VOL_DANGLING_STR "Volume is dangling"
+#define PC_MSG_CREATE_MEM_POOL_FAILED_STR \
+ "failed to create local_t's memory pool"
+#define PC_MSG_XLATOR_NULL_STR "xlator is NULL"
+#define PC_MSG_PVT_XLATOR_NULL_STR "private structure of the xlator is NULL"
+#define PC_MSG_LEASE_FOP_FAILED_STR "Lease fop failed"
+#define PC_MSG_LOCK_ERROR_STR \
+ "Unexpected case in subtract_locks. Please send a bug report to " \
+ "gluster-devel@gluster.org"
+#define PC_MSG_FD_CTX_INVALID_STR "fdctx not valid"
+#define PC_MSG_FD_GET_FAIL_STR "failed to get fd context. sending EBADFD"
+#define PC_MSG_DICT_SET_FAIL_STR "could not set dict"
+#define PC_MSG_CLIENT_LOCK_INFO_STR "client lock info"
+#define PC_MSG_BAD_FD_STR "remote_fd is -1. EBADFD"
+#define PC_MSG_FUNCTION_CALL_ERROR_STR "this function should not be called"
+#define PC_MSG_RECALL_LEASE_FAIL_STR "XDR decode of recall lease failed"
+#define PC_MSG_CACHE_INVALIDATION_FAIL_STR \
+ "XDR decode of cache_invalidation failed"
+#define PC_MSG_INODELK_CONTENTION_FAIL_STR \
+ "XDR decode of inodelk contention failed"
+#define PC_MSG_ENTRYLK_CONTENTION_FAIL_STR \
+ "XDR decode of entrylk contention failed"
+#define PC_MSG_FD_DUPLICATE_TRY_STR "trying duplicate remote fd set"
+#define PC_MSG_FD_SET_FAIL_STR "failed to set remote-fd"
+#define PC_MSG_NO_MEM_STR "No memory"
+#define PC_MSG_UNKNOWN_LOCK_TYPE_STR "Unknown lock type"
+#define PC_MSG_CLIENT_UID_ALLOC_FAILED_STR "client-uid could not be allocated"
#endif /* !_PC_MESSAGES_H__ */
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index c6f2ca137aa..f402121c15b 100644
--- a/xlators/protocol/client/src/client-rpc-fops.c
+++ b/xlators/protocol/client/src/client-rpc-fops.c
@@ -70,8 +70,8 @@ client3_3_symlink_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_symlink_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -86,10 +86,9 @@ out:
/* no need to print the gfid, because it will be null,
* since symlink operation failed.
*/
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed. Path: (%s to %s)", local->loc.path,
- local->loc2.path);
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, "loc1=%s", local->loc.path,
+ "loc2=%s", local->loc2.path, NULL);
}
}
@@ -143,8 +142,8 @@ client3_3_mknod_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_mknod_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -156,10 +155,10 @@ client3_3_mknod_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1 &&
GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, rsp.op_errno)) {
- gf_msg(this->name,
- fop_log_level(GF_FOP_MKNOD, gf_error_to_errno(rsp.op_errno)),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed. Path: %s", local->loc.path);
+ gf_smsg(this->name,
+ fop_log_level(GF_FOP_MKNOD, gf_error_to_errno(rsp.op_errno)),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
+ "path=%s", local->loc.path, NULL);
}
CLIENT_STACK_UNWIND(mknod, frame, rsp.op_ret,
@@ -211,8 +210,8 @@ client3_3_mkdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_mkdir_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -224,10 +223,10 @@ client3_3_mkdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1 &&
GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, rsp.op_errno)) {
- gf_msg(this->name,
- fop_log_level(GF_FOP_MKDIR, gf_error_to_errno(rsp.op_errno)),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed. Path: %s", local->loc.path);
+ gf_smsg(this->name,
+ fop_log_level(GF_FOP_MKDIR, gf_error_to_errno(rsp.op_errno)),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
+ "Path=%s", local->loc.path, NULL);
}
CLIENT_STACK_UNWIND(mkdir, frame, rsp.op_ret,
@@ -341,8 +340,8 @@ client3_3_open_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_open_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -361,11 +360,11 @@ client3_3_open_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_open(this, &rsp, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name,
- fop_log_level(GF_FOP_OPEN, gf_error_to_errno(rsp.op_errno)),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed. Path: %s (%s)", local->loc.path,
- loc_gfid_utoa(&local->loc));
+ gf_smsg(this->name,
+ fop_log_level(GF_FOP_OPEN, gf_error_to_errno(rsp.op_errno)),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
+ "Path=%s", local->loc.path, "gfid=%s",
+ loc_gfid_utoa(&local->loc), NULL);
}
CLIENT_STACK_UNWIND(open, frame, rsp.op_ret,
@@ -405,8 +404,8 @@ client3_3_stat_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_stat_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -421,8 +420,8 @@ out:
gf_msg_debug(this->name, 0, "remote operation failed: %s",
strerror(gf_error_to_errno(rsp.op_errno)));
} else {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
}
@@ -463,8 +462,8 @@ client3_3_readlink_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_readlink_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -480,10 +479,8 @@ out:
" %s",
strerror(gf_error_to_errno(rsp.op_errno)));
} else {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation "
- "failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
}
@@ -532,8 +529,8 @@ client3_3_unlink_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_unlink_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -549,10 +546,8 @@ out:
" %s",
strerror(gf_error_to_errno(rsp.op_errno)));
} else {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation "
- "failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
}
@@ -597,8 +592,8 @@ client3_3_rmdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_rmdir_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -609,8 +604,8 @@ client3_3_rmdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
if (GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, rsp.op_errno)) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
}
CLIENT_STACK_UNWIND(rmdir, frame, rsp.op_ret,
@@ -654,8 +649,8 @@ client3_3_truncate_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_truncate_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -665,8 +660,8 @@ client3_3_truncate_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(truncate, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &prestat, &poststat,
@@ -706,8 +701,8 @@ client3_3_statfs_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_statfs_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -717,8 +712,8 @@ client3_3_statfs_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(statfs, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &statfs, xdata);
@@ -763,8 +758,8 @@ client3_3_writev_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_write_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -775,8 +770,8 @@ client3_3_writev_cbk(struct rpc_req *req, struct iovec *iov, int count,
goto out;
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
} else if (rsp.op_ret >= 0) {
if (local->attempt_reopen)
client_attempt_reopen(local->fd, this);
@@ -818,8 +813,8 @@ client3_3_flush_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -837,10 +832,9 @@ client3_3_flush_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name,
- fop_log_level(GF_FOP_FLUSH, gf_error_to_errno(rsp.op_errno)),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed");
+ gf_smsg(this->name,
+ fop_log_level(GF_FOP_FLUSH, gf_error_to_errno(rsp.op_errno)),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(flush, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), xdata);
@@ -883,8 +877,8 @@ client3_3_fsync_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_fsync_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -896,8 +890,8 @@ client3_3_fsync_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(fsync, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &prestat, &poststat,
@@ -936,8 +930,8 @@ client3_3_setxattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -956,10 +950,8 @@ out:
" %s",
strerror(op_errno));
} else {
- gf_msg(this->name, GF_LOG_WARNING, op_errno,
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation "
- "failed");
+ gf_smsg(this->name, GF_LOG_WARNING, op_errno,
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
}
@@ -1001,8 +993,8 @@ client3_3_getxattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_getxattr_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -1026,12 +1018,10 @@ out:
loc_gfid_utoa(&local->loc),
(local->name) ? local->name : "(null)");
} else {
- gf_msg(this->name, GF_LOG_WARNING, op_errno,
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation "
- "failed. Path: %s (%s). Key: %s",
- local->loc.path, loc_gfid_utoa(&local->loc),
- (local->name) ? local->name : "(null)");
+ gf_smsg(this->name, GF_LOG_WARNING, op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "Path=%s", local->loc.path,
+ "gfid=%s", loc_gfid_utoa(&local->loc), "Key=%s",
+ (local->name) ? local->name : "(null)", NULL);
}
}
@@ -1076,8 +1066,8 @@ client3_3_fgetxattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_fgetxattr_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -1096,10 +1086,8 @@ out:
gf_msg_debug(this->name, 0, "remote operation failed: %s",
strerror(op_errno));
} else {
- gf_msg(this->name, GF_LOG_WARNING, op_errno,
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation "
- "failed");
+ gf_smsg(this->name, GF_LOG_WARNING, op_errno,
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
}
@@ -1143,8 +1131,8 @@ client3_3_removexattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1163,8 +1151,8 @@ out:
else
loglevel = GF_LOG_WARNING;
- gf_msg(this->name, loglevel, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, loglevel, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(removexattr, frame, rsp.op_ret,
@@ -1202,8 +1190,8 @@ client3_3_fremovexattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1212,8 +1200,8 @@ client3_3_fremovexattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_fremovexattr(this, &rsp, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(fremovexattr, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), xdata);
@@ -1249,8 +1237,8 @@ client3_3_fsyncdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1260,8 +1248,8 @@ client3_3_fsyncdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(fsyncdir, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), xdata);
@@ -1297,8 +1285,8 @@ client3_3_access_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1308,8 +1296,8 @@ client3_3_access_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(access, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), xdata);
@@ -1351,8 +1339,8 @@ client3_3_ftruncate_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_ftruncate_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1362,8 +1350,8 @@ client3_3_ftruncate_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(ftruncate, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &prestat, &poststat,
@@ -1403,8 +1391,8 @@ client3_3_fstat_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_fstat_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1414,8 +1402,8 @@ client3_3_fstat_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(fstat, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &stat, xdata);
@@ -1451,8 +1439,8 @@ client3_3_inodelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1461,10 +1449,9 @@ client3_3_inodelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_inodelk(this, &rsp, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name,
- fop_log_level(GF_FOP_INODELK, gf_error_to_errno(rsp.op_errno)),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed");
+ gf_smsg(this->name,
+ fop_log_level(GF_FOP_INODELK, gf_error_to_errno(rsp.op_errno)),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(inodelk, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), xdata);
@@ -1501,8 +1488,8 @@ client3_3_finodelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1511,10 +1498,9 @@ client3_3_finodelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_finodelk(this, &rsp, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name,
- fop_log_level(GF_FOP_FINODELK, gf_error_to_errno(rsp.op_errno)),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed");
+ gf_smsg(this->name,
+ fop_log_level(GF_FOP_FINODELK, gf_error_to_errno(rsp.op_errno)),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL);
} else if (rsp.op_ret == 0) {
if (local->attempt_reopen)
client_attempt_reopen(local->fd, this);
@@ -1553,8 +1539,8 @@ client3_3_entrylk_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1563,10 +1549,9 @@ client3_3_entrylk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_entrylk(this, &rsp, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name,
- fop_log_level(GF_FOP_ENTRYLK, gf_error_to_errno(rsp.op_errno)),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed");
+ gf_smsg(this->name,
+ fop_log_level(GF_FOP_ENTRYLK, gf_error_to_errno(rsp.op_errno)),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(entrylk, frame, rsp.op_ret,
@@ -1603,8 +1588,8 @@ client3_3_fentrylk_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1614,8 +1599,8 @@ client3_3_fentrylk_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if ((rsp.op_ret == -1) && (EAGAIN != gf_error_to_errno(rsp.op_errno))) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(fentrylk, frame, rsp.op_ret,
@@ -1656,8 +1641,8 @@ client3_3_xattrop_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_xattrop_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -1671,11 +1656,10 @@ client3_3_xattrop_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, fop_log_level(GF_FOP_XATTROP, op_errno),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed. "
- "Path: %s (%s)",
- local->loc.path, loc_gfid_utoa(&local->loc));
+ gf_smsg(this->name, fop_log_level(GF_FOP_XATTROP, op_errno),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
+ "Path=%s", local->loc.path, "gfid=%s",
+ loc_gfid_utoa(&local->loc), NULL);
}
CLIENT_STACK_UNWIND(xattrop, frame, rsp.op_ret, gf_error_to_errno(op_errno),
@@ -1724,8 +1708,8 @@ client3_3_fxattrop_cbk(struct rpc_req *req, struct iovec *iov, int count,
if (ret < 0) {
rsp.op_ret = -1;
op_errno = EINVAL;
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
goto out;
}
op_errno = rsp.op_errno;
@@ -1738,8 +1722,8 @@ client3_3_fxattrop_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
} else if (rsp.op_ret == 0) {
if (local->attempt_reopen)
client_attempt_reopen(local->fd, this);
@@ -1784,8 +1768,8 @@ client3_3_fsetxattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1802,10 +1786,8 @@ out:
" %s",
strerror(op_errno));
} else {
- gf_msg(this->name, GF_LOG_WARNING, rsp.op_errno,
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation "
- "failed");
+ gf_smsg(this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
}
@@ -1848,8 +1830,8 @@ client3_3_fsetattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_fsetattr_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1858,8 +1840,8 @@ client3_3_fsetattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_fsetattr(this, &rsp, &prestat, &poststat, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(fsetattr, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &prestat, &poststat,
@@ -1902,8 +1884,8 @@ client3_3_fallocate_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_fallocate_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1918,8 +1900,8 @@ client3_3_fallocate_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(fallocate, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &prestat, &poststat,
@@ -1962,8 +1944,8 @@ client3_3_discard_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_discard_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1973,8 +1955,8 @@ client3_3_discard_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(discard, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &prestat, &poststat,
@@ -2017,8 +1999,8 @@ client3_3_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_zerofill_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2027,8 +2009,8 @@ client3_3_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_zerofill(this, &rsp, &prestat, &poststat, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(zerofill, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &prestat, &poststat,
@@ -2065,8 +2047,8 @@ client3_3_ipc_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_ipc_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2075,8 +2057,8 @@ client3_3_ipc_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_ipc(this, &rsp, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(ipc, frame, rsp.op_ret, gf_error_to_errno(rsp.op_errno),
xdata);
@@ -2112,8 +2094,8 @@ client3_3_seek_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_seek_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2123,8 +2105,8 @@ client3_3_seek_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(seek, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), rsp.offset, xdata);
@@ -2167,8 +2149,8 @@ client3_3_setattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_setattr_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2178,8 +2160,8 @@ client3_3_setattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(setattr, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &prestat, &poststat,
@@ -2232,8 +2214,8 @@ client3_3_create_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_create_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2255,9 +2237,8 @@ client3_3_create_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed. Path: %s",
- local->loc.path);
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, "Path=%s", local->loc.path, NULL);
}
CLIENT_STACK_UNWIND(create, frame, rsp.op_ret,
@@ -2296,8 +2277,8 @@ client3_3_rchecksum_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_rchecksum_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2307,8 +2288,8 @@ client3_3_rchecksum_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(rchecksum, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), rsp.weak_checksum,
@@ -2349,8 +2330,8 @@ client3_3_lease_cbk(struct rpc_req *req, struct iovec *iov, int count,
frame = myframe;
if (-1 == req->rpc_status) {
- gf_msg(this->name, GF_LOG_ERROR, ENOTCONN, PC_MSG_REMOTE_OP_FAILED,
- "Lease fop failed");
+ gf_smsg(this->name, GF_LOG_ERROR, ENOTCONN, PC_MSG_LEASE_FOP_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = ENOTCONN;
goto out;
@@ -2358,8 +2339,8 @@ client3_3_lease_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_lease_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2369,8 +2350,8 @@ client3_3_lease_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(lease, frame, rsp.op_ret,
@@ -2413,8 +2394,8 @@ client3_3_lk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_lk_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2440,8 +2421,8 @@ client3_3_lk_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if ((rsp.op_ret == -1) && (EAGAIN != gf_error_to_errno(rsp.op_errno))) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(lk, frame, rsp.op_ret, gf_error_to_errno(rsp.op_errno),
@@ -2486,8 +2467,8 @@ client3_3_readdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_readdir_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2497,9 +2478,8 @@ client3_3_readdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed: remote_fd = %d", local->cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, "remote_fd=%d", local->cmd, NULL);
}
CLIENT_STACK_UNWIND(readdir, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &entries, xdata);
@@ -2547,8 +2527,8 @@ client3_3_readdirp_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_readdirp_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2557,8 +2537,8 @@ client3_3_readdirp_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_readdirp(this, &rsp, local->fd, &entries, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(readdirp, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &entries, xdata);
@@ -2615,8 +2595,8 @@ client3_3_rename_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_rename_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2627,8 +2607,8 @@ client3_3_rename_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(rename, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), &stbuf, &preoldparent,
@@ -2680,8 +2660,8 @@ client3_3_link_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_link_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2691,10 +2671,9 @@ client3_3_link_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
if (GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, rsp.op_errno)) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed: (%s -> %s)", local->loc.path,
- local->loc2.path);
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, "loc1=%s", local->loc.path,
+ "loc2=%s", local->loc2.path, NULL);
}
}
@@ -2739,8 +2718,8 @@ client3_3_opendir_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_opendir_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2759,12 +2738,11 @@ client3_3_opendir_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = client_post_opendir(this, &rsp, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name,
- fop_log_level(GF_FOP_OPENDIR, gf_error_to_errno(rsp.op_errno)),
- gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
- "remote operation failed."
- " Path: %s (%s)",
- local->loc.path, loc_gfid_utoa(&local->loc));
+ gf_smsg(this->name,
+ fop_log_level(GF_FOP_OPENDIR, gf_error_to_errno(rsp.op_errno)),
+ gf_error_to_errno(rsp.op_errno), PC_MSG_REMOTE_OP_FAILED,
+ "Path=%s", local->loc.path, "gfid=%s",
+ loc_gfid_utoa(&local->loc), NULL);
}
CLIENT_STACK_UNWIND(opendir, frame, rsp.op_ret,
gf_error_to_errno(rsp.op_errno), fd, xdata);
@@ -2812,8 +2790,8 @@ client3_3_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_lookup_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -2856,11 +2834,9 @@ out:
/* any error other than ENOENT */
if (!(local->loc.name && rsp.op_errno == ENOENT) &&
!(rsp.op_errno == ESTALE))
- gf_msg(this->name, GF_LOG_WARNING, rsp.op_errno,
- PC_MSG_REMOTE_OP_FAILED,
- "remote operation "
- "failed. Path: %s (%s)",
- local->loc.path, loc_gfid_utoa(&local->loc));
+ gf_smsg(this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "Path=%s", local->loc.path,
+ "gfid=%s", loc_gfid_utoa(&local->loc), NULL);
else
gf_msg_trace(this->name, 0,
"not found on remote "
@@ -2911,8 +2887,8 @@ client3_3_readv_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_read_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2924,8 +2900,8 @@ client3_3_readv_cbk(struct rpc_req *req, struct iovec *iov, int count,
&req->rsp[1], &rspcount, &xdata);
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
} else if (rsp.op_ret >= 0) {
if (local->attempt_reopen)
client_attempt_reopen(local->fd, this);
@@ -2988,8 +2964,8 @@ client3_3_getactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_getactivelk_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -3006,8 +2982,8 @@ client3_3_getactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(getactivelk, frame, rsp.op_ret,
@@ -3047,8 +3023,8 @@ client3_3_setactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfs3_setactivelk_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -3059,8 +3035,8 @@ client3_3_setactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_msg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
- PC_MSG_REMOTE_OP_FAILED, "remote operation failed");
+ gf_smsg(this->name, GF_LOG_WARNING, gf_error_to_errno(rsp.op_errno),
+ PC_MSG_REMOTE_OP_FAILED, NULL);
}
CLIENT_STACK_UNWIND(setactivelk, frame, rsp.op_ret,
@@ -3244,8 +3220,7 @@ client3_3_lookup(call_frame_t *frame, xlator_t *this, void *data)
(xdrproc_t)xdr_gfs3_lookup_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3291,8 +3266,7 @@ client3_3_stat(call_frame_t *frame, xlator_t *this, void *data)
client3_3_stat_cbk, NULL,
(xdrproc_t)xdr_gfs3_stat_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3334,8 +3308,7 @@ client3_3_truncate(call_frame_t *frame, xlator_t *this, void *data)
client3_3_truncate_cbk, NULL,
(xdrproc_t)xdr_gfs3_truncate_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3377,8 +3350,7 @@ client3_3_ftruncate(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_FTRUNCATE, client3_3_ftruncate_cbk,
NULL, (xdrproc_t)xdr_gfs3_ftruncate_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3420,8 +3392,7 @@ client3_3_access(call_frame_t *frame, xlator_t *this, void *data)
client3_3_access_cbk, NULL,
(xdrproc_t)xdr_gfs3_access_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3505,8 +3476,7 @@ client3_3_readlink(call_frame_t *frame, xlator_t *this, void *data)
client3_3_readlink_cbk, &cp,
(xdrproc_t)xdr_gfs3_readlink_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3551,8 +3521,7 @@ client3_3_unlink(call_frame_t *frame, xlator_t *this, void *data)
client3_3_unlink_cbk, NULL,
(xdrproc_t)xdr_gfs3_unlink_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3594,8 +3563,7 @@ client3_3_rmdir(call_frame_t *frame, xlator_t *this, void *data)
client3_3_rmdir_cbk, NULL,
(xdrproc_t)xdr_gfs3_rmdir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3653,8 +3621,7 @@ client3_3_symlink(call_frame_t *frame, xlator_t *this, void *data)
client3_3_symlink_cbk, NULL,
(xdrproc_t)xdr_gfs3_symlink_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3699,8 +3666,7 @@ client3_3_rename(call_frame_t *frame, xlator_t *this, void *data)
client3_3_rename_cbk, NULL,
(xdrproc_t)xdr_gfs3_rename_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3758,8 +3724,7 @@ client3_3_link(call_frame_t *frame, xlator_t *this, void *data)
client3_3_link_cbk, NULL,
(xdrproc_t)xdr_gfs3_link_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3813,8 +3778,7 @@ client3_3_mknod(call_frame_t *frame, xlator_t *this, void *data)
client3_3_mknod_cbk, NULL,
(xdrproc_t)xdr_gfs3_mknod_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3880,8 +3844,7 @@ client3_3_mkdir(call_frame_t *frame, xlator_t *this, void *data)
client3_3_mkdir_cbk, NULL,
(xdrproc_t)xdr_gfs3_mkdir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3938,8 +3901,7 @@ client3_3_create(call_frame_t *frame, xlator_t *this, void *data)
client3_3_create_cbk, NULL,
(xdrproc_t)xdr_gfs3_create_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -3999,8 +3961,7 @@ client3_3_open(call_frame_t *frame, xlator_t *this, void *data)
client3_3_open_cbk, NULL,
(xdrproc_t)xdr_gfs3_open_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4074,9 +4035,9 @@ client3_3_readv(call_frame_t *frame, xlator_t *this, void *data)
rsp_iobuf = NULL;
if (args->size > rsp_vec.iov_len) {
- gf_msg(this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_NO_MEMORY,
- "read-size (%lu) is bigger than iobuf size (%lu)",
- (unsigned long)args->size, (unsigned long)rsp_vec.iov_len);
+ gf_smsg(this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_BIGGER_SIZE,
+ "read-size=%lu", (unsigned long)args->size, "iobuf size=%lu",
+ (unsigned long)rsp_vec.iov_len, NULL);
op_errno = EINVAL;
goto unwind;
}
@@ -4093,8 +4054,7 @@ client3_3_readv(call_frame_t *frame, xlator_t *this, void *data)
(xdrproc_t)xdr_gfs3_read_req);
if (ret) {
// unwind is done in the cbk
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4160,8 +4120,7 @@ client3_3_writev(call_frame_t *frame, xlator_t *this, void *data)
* do the unwind for us (see rpc_clnt_submit), so don't unwind
* here in such cases.
*/
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4222,8 +4181,7 @@ client3_3_flush(call_frame_t *frame, xlator_t *this, void *data)
client3_3_flush_cbk, NULL,
(xdrproc_t)xdr_gfs3_flush_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4265,8 +4223,7 @@ client3_3_fsync(call_frame_t *frame, xlator_t *this, void *data)
client3_3_fsync_cbk, NULL,
(xdrproc_t)xdr_gfs3_fsync_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4310,8 +4267,7 @@ client3_3_fstat(call_frame_t *frame, xlator_t *this, void *data)
client3_3_fstat_cbk, NULL,
(xdrproc_t)xdr_gfs3_fstat_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4365,8 +4321,7 @@ client3_3_opendir(call_frame_t *frame, xlator_t *this, void *data)
client3_3_opendir_cbk, NULL,
(xdrproc_t)xdr_gfs3_opendir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4409,8 +4364,7 @@ client3_3_fsyncdir(call_frame_t *frame, xlator_t *this, void *data)
client3_3_fsyncdir_cbk, NULL,
(xdrproc_t)xdr_gfs3_fsyncdir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4453,8 +4407,7 @@ client3_3_statfs(call_frame_t *frame, xlator_t *this, void *data)
client3_3_statfs_cbk, NULL,
(xdrproc_t)xdr_gfs3_statfs_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4497,8 +4450,7 @@ client3_3_setxattr(call_frame_t *frame, xlator_t *this, void *data)
client3_3_setxattr_cbk, NULL,
(xdrproc_t)xdr_gfs3_setxattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.dict_val);
@@ -4543,8 +4495,7 @@ client3_3_fsetxattr(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_FSETXATTR, client3_3_fsetxattr_cbk,
NULL, (xdrproc_t)xdr_gfs3_fsetxattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.dict_val);
@@ -4634,8 +4585,7 @@ client3_3_fgetxattr(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_FGETXATTR, client3_3_fgetxattr_cbk, &cp,
(xdrproc_t)xdr_gfs3_fgetxattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4733,9 +4683,8 @@ client3_3_getxattr(call_frame_t *frame, xlator_t *this, void *data)
ret = client_dump_locks((char *)args->name, args->loc->inode, dict);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Client dump "
- "locks failed");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL,
+ PC_MSG_CLIENT_DUMP_LOCKS_FAILED, NULL);
op_errno = ENOMEM;
goto unwind;
}
@@ -4761,8 +4710,7 @@ client3_3_getxattr(call_frame_t *frame, xlator_t *this, void *data)
client3_3_getxattr_cbk, &cp,
(xdrproc_t)xdr_gfs3_getxattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -4862,8 +4810,7 @@ client3_3_xattrop(call_frame_t *frame, xlator_t *this, void *data)
client3_3_xattrop_cbk, &cp,
(xdrproc_t)xdr_gfs3_xattrop_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.dict_val);
@@ -4957,8 +4904,7 @@ client3_3_fxattrop(call_frame_t *frame, xlator_t *this, void *data)
client3_3_fxattrop_cbk, &cp,
(xdrproc_t)xdr_gfs3_fxattrop_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.dict_val);
@@ -5008,8 +4954,7 @@ client3_3_removexattr(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_REMOVEXATTR, client3_3_removexattr_cbk,
NULL, (xdrproc_t)xdr_gfs3_removexattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5052,8 +4997,7 @@ client3_3_fremovexattr(call_frame_t *frame, xlator_t *this, void *data)
this, &req, frame, conf->fops, GFS3_OP_FREMOVEXATTR,
client3_3_fremovexattr_cbk, NULL, (xdrproc_t)xdr_gfs3_fremovexattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5095,8 +5039,7 @@ client3_3_lease(call_frame_t *frame, xlator_t *this, void *data)
client3_3_lease_cbk, NULL,
(xdrproc_t)xdr_gfs3_lease_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5139,8 +5082,8 @@ client3_3_lk(call_frame_t *frame, xlator_t *this, void *data)
ret = client_cmd_to_gf_cmd(args->cmd, &gf_cmd);
if (ret) {
op_errno = EINVAL;
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_UNKNOWN_CMD,
+ "gf_cmd=%d", gf_cmd, NULL);
goto unwind;
}
@@ -5166,8 +5109,7 @@ client3_3_lk(call_frame_t *frame, xlator_t *this, void *data)
client3_3_lk_cbk, NULL,
(xdrproc_t)xdr_gfs3_lk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5209,8 +5151,7 @@ client3_3_inodelk(call_frame_t *frame, xlator_t *this, void *data)
client3_3_inodelk_cbk, NULL,
(xdrproc_t)xdr_gfs3_inodelk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5259,8 +5200,7 @@ client3_3_finodelk(call_frame_t *frame, xlator_t *this, void *data)
client3_3_finodelk_cbk, NULL,
(xdrproc_t)xdr_gfs3_finodelk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5304,8 +5244,7 @@ client3_3_entrylk(call_frame_t *frame, xlator_t *this, void *data)
client3_3_entrylk_cbk, NULL,
(xdrproc_t)xdr_gfs3_entrylk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5348,8 +5287,7 @@ client3_3_fentrylk(call_frame_t *frame, xlator_t *this, void *data)
client3_3_fentrylk_cbk, NULL,
(xdrproc_t)xdr_gfs3_fentrylk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5389,8 +5327,7 @@ client3_3_rchecksum(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_RCHECKSUM, client3_3_rchecksum_cbk,
NULL, (xdrproc_t)xdr_gfs3_rchecksum_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5491,8 +5428,7 @@ client3_3_readdir(call_frame_t *frame, xlator_t *this, void *data)
(xdrproc_t)xdr_gfs3_readdir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5595,8 +5531,7 @@ client3_3_readdirp(call_frame_t *frame, xlator_t *this, void *data)
client3_3_readdirp_cbk, &cp,
(xdrproc_t)xdr_gfs3_readdirp_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.dict_val);
@@ -5643,8 +5578,7 @@ client3_3_setattr(call_frame_t *frame, xlator_t *this, void *data)
client3_3_setattr_cbk, NULL,
(xdrproc_t)xdr_gfs3_setattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5685,8 +5619,7 @@ client3_3_fsetattr(call_frame_t *frame, xlator_t *this, void *data)
client3_3_fsetattr_cbk, NULL,
(xdrproc_t)xdr_gfs3_fsetattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5727,8 +5660,7 @@ client3_3_fallocate(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_FALLOCATE, client3_3_fallocate_cbk,
NULL, (xdrproc_t)xdr_gfs3_fallocate_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -5769,8 +5701,7 @@ client3_3_discard(call_frame_t *frame, xlator_t *this, void *data)
client3_3_discard_cbk, NULL,
(xdrproc_t)xdr_gfs3_discard_req);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
GF_FREE(req.xdata.xdata_val);
@@ -5812,8 +5743,7 @@ client3_3_zerofill(call_frame_t *frame, xlator_t *this, void *data)
client3_3_zerofill_cbk, NULL,
(xdrproc_t)xdr_gfs3_zerofill_req);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
GF_FREE(req.xdata.xdata_val);
@@ -5855,8 +5785,7 @@ client3_3_ipc(call_frame_t *frame, xlator_t *this, void *data)
client3_3_ipc_cbk, NULL,
(xdrproc_t)xdr_gfs3_ipc_req);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
GF_FREE(req.xdata.xdata_val);
@@ -5900,8 +5829,7 @@ client3_3_seek(call_frame_t *frame, xlator_t *this, void *data)
client3_3_seek_cbk, NULL,
(xdrproc_t)xdr_gfs3_seek_req);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
GF_FREE(req.xdata.xdata_val);
@@ -5950,8 +5878,7 @@ client3_3_getactivelk(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_GETACTIVELK, client3_3_getactivelk_cbk,
NULL, (xdrproc_t)xdr_gfs3_getactivelk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.xdata_val);
@@ -6007,8 +5934,7 @@ client3_3_setactivelk(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_SETACTIVELK, client3_3_setactivelk_cbk,
NULL, (xdrproc_t)xdr_gfs3_setactivelk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
clnt_setactivelk_req_cleanup(&req);
diff --git a/xlators/protocol/client/src/client-rpc-fops_v2.c b/xlators/protocol/client/src/client-rpc-fops_v2.c
index 756722494d0..0d80d4e8efb 100644
--- a/xlators/protocol/client/src/client-rpc-fops_v2.c
+++ b/xlators/protocol/client/src/client-rpc-fops_v2.c
@@ -59,8 +59,8 @@ client4_0_symlink_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_3iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -129,8 +129,8 @@ client4_0_mknod_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_3iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -195,8 +195,8 @@ client4_0_mkdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_3iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -252,8 +252,8 @@ client4_0_open_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_open_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -314,8 +314,8 @@ client4_0_stat_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -370,8 +370,8 @@ client4_0_readlink_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_readlink_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -435,8 +435,8 @@ client4_0_unlink_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -496,8 +496,8 @@ client4_0_rmdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -551,8 +551,8 @@ client4_0_truncate_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -601,8 +601,8 @@ client4_0_statfs_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_statfs_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -658,8 +658,8 @@ client4_0_writev_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -710,8 +710,8 @@ client4_0_flush_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -772,8 +772,8 @@ client4_0_fsync_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -822,8 +822,8 @@ client4_0_setxattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -880,8 +880,8 @@ client4_0_getxattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_dict_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -954,8 +954,8 @@ client4_0_fgetxattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_dict_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -1021,8 +1021,8 @@ client4_0_removexattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1078,8 +1078,8 @@ client4_0_fremovexattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1123,8 +1123,8 @@ client4_0_fsyncdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1169,8 +1169,8 @@ client4_0_access_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1221,8 +1221,8 @@ client4_0_ftruncate_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1271,8 +1271,8 @@ client4_0_fstat_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1317,8 +1317,8 @@ client4_0_inodelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1364,8 +1364,8 @@ client4_0_finodelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1413,8 +1413,8 @@ client4_0_entrylk_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1460,8 +1460,8 @@ client4_0_fentrylk_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1511,8 +1511,8 @@ client4_0_xattrop_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_dict_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -1580,8 +1580,8 @@ client4_0_fxattrop_cbk(struct rpc_req *req, struct iovec *iov, int count,
if (ret < 0) {
rsp.op_ret = -1;
op_errno = EINVAL;
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
goto out;
}
op_errno = rsp.op_errno;
@@ -1642,8 +1642,8 @@ client4_0_fsetxattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1702,8 +1702,8 @@ client4_0_fallocate_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1757,8 +1757,8 @@ client4_0_discard_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1809,8 +1809,8 @@ client4_0_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1855,8 +1855,8 @@ client4_0_ipc_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1900,8 +1900,8 @@ client4_0_seek_cbk(struct rpc_req *req, struct iovec *iov, int count,
}
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_seek_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1952,8 +1952,8 @@ client4_0_setattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2006,8 +2006,8 @@ client4_0_fsetattr_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2069,18 +2069,19 @@ client4_0_create_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_create_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
}
+ ret = client_post_create_v2(this, &rsp, &stbuf, &preparent, &postparent,
+ local, &xdata);
+ if (ret < 0)
+ goto out;
+
if (-1 != rsp.op_ret) {
- ret = client_post_create_v2(this, &rsp, &stbuf, &preparent, &postparent,
- local, &xdata);
- if (ret < 0)
- goto out;
ret = client_add_fd_to_saved_fds(frame->this, fd, &local->loc,
local->flags, rsp.fd, 0);
if (ret) {
@@ -2135,8 +2136,8 @@ client4_0_lease_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_lease_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2188,8 +2189,8 @@ client4_0_lk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_lk_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2259,8 +2260,8 @@ client4_0_readdir_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_readdir_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2317,8 +2318,8 @@ client4_0_readdirp_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_readdirp_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2384,8 +2385,8 @@ client4_0_rename_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_rename_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2446,8 +2447,8 @@ client4_0_link_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_3iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2505,8 +2506,8 @@ client4_0_opendir_cbk(struct rpc_req *req, struct iovec *iov, int count,
but separated by fop number only */
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_open_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2575,8 +2576,8 @@ client4_0_lookup_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_2iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -2670,8 +2671,8 @@ client4_0_readv_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_read_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2745,8 +2746,8 @@ client4_0_getactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_getactivelk_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2800,8 +2801,8 @@ client4_0_setactivelk_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2858,8 +2859,8 @@ client4_0_copy_file_range_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_3iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -3060,8 +3061,7 @@ client4_0_lookup(call_frame_t *frame, xlator_t *this, void *data)
(xdrproc_t)xdr_gfx_lookup_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3107,8 +3107,7 @@ client4_0_stat(call_frame_t *frame, xlator_t *this, void *data)
client4_0_stat_cbk, NULL,
(xdrproc_t)xdr_gfx_stat_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3151,8 +3150,7 @@ client4_0_truncate(call_frame_t *frame, xlator_t *this, void *data)
client4_0_truncate_cbk, NULL,
(xdrproc_t)xdr_gfx_truncate_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3195,8 +3193,7 @@ client4_0_ftruncate(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_FTRUNCATE, client4_0_ftruncate_cbk,
NULL, (xdrproc_t)xdr_gfx_ftruncate_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3238,8 +3235,7 @@ client4_0_access(call_frame_t *frame, xlator_t *this, void *data)
client4_0_access_cbk, NULL,
(xdrproc_t)xdr_gfx_access_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3292,8 +3288,7 @@ client4_0_readlink(call_frame_t *frame, xlator_t *this, void *data)
client4_0_readlink_cbk, NULL,
(xdrproc_t)xdr_gfx_readlink_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3335,8 +3330,7 @@ client4_0_unlink(call_frame_t *frame, xlator_t *this, void *data)
client4_0_unlink_cbk, NULL,
(xdrproc_t)xdr_gfx_unlink_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3378,8 +3372,7 @@ client4_0_rmdir(call_frame_t *frame, xlator_t *this, void *data)
client4_0_rmdir_cbk, NULL,
(xdrproc_t)xdr_gfx_rmdir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3437,8 +3430,7 @@ client4_0_symlink(call_frame_t *frame, xlator_t *this, void *data)
client4_0_symlink_cbk, NULL,
(xdrproc_t)xdr_gfx_symlink_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3483,8 +3475,7 @@ client4_0_rename(call_frame_t *frame, xlator_t *this, void *data)
client4_0_rename_cbk, NULL,
(xdrproc_t)xdr_gfx_rename_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3543,8 +3534,7 @@ client4_0_link(call_frame_t *frame, xlator_t *this, void *data)
client4_0_link_cbk, NULL,
(xdrproc_t)xdr_gfx_link_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3598,8 +3588,7 @@ client4_0_mknod(call_frame_t *frame, xlator_t *this, void *data)
client4_0_mknod_cbk, NULL,
(xdrproc_t)xdr_gfx_mknod_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3665,8 +3654,7 @@ client4_0_mkdir(call_frame_t *frame, xlator_t *this, void *data)
client4_0_mkdir_cbk, NULL,
(xdrproc_t)xdr_gfx_mkdir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3723,8 +3711,7 @@ client4_0_create(call_frame_t *frame, xlator_t *this, void *data)
client4_0_create_cbk, NULL,
(xdrproc_t)xdr_gfx_create_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3784,8 +3771,7 @@ client4_0_open(call_frame_t *frame, xlator_t *this, void *data)
client4_0_open_cbk, NULL,
(xdrproc_t)xdr_gfx_open_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3860,9 +3846,9 @@ client4_0_readv(call_frame_t *frame, xlator_t *this, void *data)
rsp_iobuf = NULL;
if (args->size > rsp_vec.iov_len) {
- gf_msg(this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_NO_MEMORY,
- "read-size (%lu) is bigger than iobuf size (%lu)",
- (unsigned long)args->size, (unsigned long)rsp_vec.iov_len);
+ gf_smsg(this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_BIGGER_SIZE,
+ "read-size=%lu", (unsigned long)args->size, "iobuf-size=%lu",
+ (unsigned long)rsp_vec.iov_len, NULL);
op_errno = EINVAL;
goto unwind;
}
@@ -3876,8 +3862,7 @@ client4_0_readv(call_frame_t *frame, xlator_t *this, void *data)
client4_0_readv_cbk, &cp,
(xdrproc_t)xdr_gfx_read_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -3941,8 +3926,7 @@ client4_0_writev(call_frame_t *frame, xlator_t *this, void *data)
* do the unwind for us (see rpc_clnt_submit), so don't unwind
* here in such cases.
*/
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4002,8 +3986,7 @@ client4_0_flush(call_frame_t *frame, xlator_t *this, void *data)
client4_0_flush_cbk, NULL,
(xdrproc_t)xdr_gfx_flush_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4045,8 +4028,7 @@ client4_0_fsync(call_frame_t *frame, xlator_t *this, void *data)
client4_0_fsync_cbk, NULL,
(xdrproc_t)xdr_gfx_fsync_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4090,8 +4072,7 @@ client4_0_fstat(call_frame_t *frame, xlator_t *this, void *data)
client4_0_fstat_cbk, NULL,
(xdrproc_t)xdr_gfx_fstat_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4145,8 +4126,7 @@ client4_0_opendir(call_frame_t *frame, xlator_t *this, void *data)
client4_0_opendir_cbk, NULL,
(xdrproc_t)xdr_gfx_opendir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4190,8 +4170,7 @@ client4_0_fsyncdir(call_frame_t *frame, xlator_t *this, void *data)
client4_0_fsyncdir_cbk, NULL,
(xdrproc_t)xdr_gfx_fsyncdir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4234,8 +4213,7 @@ client4_0_statfs(call_frame_t *frame, xlator_t *this, void *data)
client4_0_statfs_cbk, NULL,
(xdrproc_t)xdr_gfx_statfs_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4278,8 +4256,7 @@ client4_0_setxattr(call_frame_t *frame, xlator_t *this, void *data)
client4_0_setxattr_cbk, NULL,
(xdrproc_t)xdr_gfx_setxattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.pairs.pairs_val);
@@ -4324,8 +4301,7 @@ client4_0_fsetxattr(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_FSETXATTR, client4_0_fsetxattr_cbk,
NULL, (xdrproc_t)xdr_gfx_fsetxattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.pairs.pairs_val);
@@ -4377,8 +4353,7 @@ client4_0_fgetxattr(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_FGETXATTR, client4_0_fgetxattr_cbk,
NULL, (xdrproc_t)xdr_gfx_fgetxattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4441,9 +4416,8 @@ client4_0_getxattr(call_frame_t *frame, xlator_t *this, void *data)
ret = client_dump_locks((char *)args->name, args->loc->inode, dict);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Client dump "
- "locks failed");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL,
+ PC_MSG_CLIENT_DUMP_LOCKS_FAILED, NULL);
op_errno = ENOMEM;
goto unwind;
}
@@ -4465,8 +4439,7 @@ client4_0_getxattr(call_frame_t *frame, xlator_t *this, void *data)
client4_0_getxattr_cbk, NULL,
(xdrproc_t)xdr_gfx_getxattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4527,8 +4500,7 @@ client4_0_xattrop(call_frame_t *frame, xlator_t *this, void *data)
client4_0_xattrop_cbk, NULL,
(xdrproc_t)xdr_gfx_xattrop_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.pairs.pairs_val);
@@ -4579,8 +4551,7 @@ client4_0_fxattrop(call_frame_t *frame, xlator_t *this, void *data)
client4_0_fxattrop_cbk, NULL,
(xdrproc_t)xdr_gfx_fxattrop_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.dict.pairs.pairs_val);
@@ -4625,8 +4596,7 @@ client4_0_removexattr(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_REMOVEXATTR, client4_0_removexattr_cbk,
NULL, (xdrproc_t)xdr_gfx_removexattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4669,8 +4639,7 @@ client4_0_fremovexattr(call_frame_t *frame, xlator_t *this, void *data)
this, &req, frame, conf->fops, GFS3_OP_FREMOVEXATTR,
client4_0_fremovexattr_cbk, NULL, (xdrproc_t)xdr_gfx_fremovexattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4712,8 +4681,7 @@ client4_0_lease(call_frame_t *frame, xlator_t *this, void *data)
client4_0_lease_cbk, NULL,
(xdrproc_t)xdr_gfx_lease_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4756,8 +4724,8 @@ client4_0_lk(call_frame_t *frame, xlator_t *this, void *data)
ret = client_cmd_to_gf_cmd(args->cmd, &gf_cmd);
if (ret) {
op_errno = EINVAL;
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_UNKNOWN_CMD,
+ "gf_cmd=%d", gf_cmd, NULL);
goto unwind;
}
@@ -4783,8 +4751,7 @@ client4_0_lk(call_frame_t *frame, xlator_t *this, void *data)
client4_0_lk_cbk, NULL,
(xdrproc_t)xdr_gfx_lk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4826,8 +4793,7 @@ client4_0_inodelk(call_frame_t *frame, xlator_t *this, void *data)
client4_0_inodelk_cbk, NULL,
(xdrproc_t)xdr_gfx_inodelk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4876,8 +4842,7 @@ client4_0_finodelk(call_frame_t *frame, xlator_t *this, void *data)
client4_0_finodelk_cbk, NULL,
(xdrproc_t)xdr_gfx_finodelk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4921,8 +4886,7 @@ client4_0_entrylk(call_frame_t *frame, xlator_t *this, void *data)
client4_0_entrylk_cbk, NULL,
(xdrproc_t)xdr_gfx_entrylk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -4965,8 +4929,7 @@ client4_0_fentrylk(call_frame_t *frame, xlator_t *this, void *data)
client4_0_fentrylk_cbk, NULL,
(xdrproc_t)xdr_gfx_fentrylk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5068,8 +5031,7 @@ client4_0_readdir(call_frame_t *frame, xlator_t *this, void *data)
(xdrproc_t)xdr_gfx_readdir_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5173,8 +5135,7 @@ client4_0_readdirp(call_frame_t *frame, xlator_t *this, void *data)
client4_0_readdirp_cbk, &cp,
(xdrproc_t)xdr_gfx_readdirp_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5221,8 +5182,7 @@ client4_0_setattr(call_frame_t *frame, xlator_t *this, void *data)
client4_0_setattr_cbk, NULL,
(xdrproc_t)xdr_gfx_setattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5263,8 +5223,7 @@ client4_0_fallocate(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_FALLOCATE, client4_0_fallocate_cbk,
NULL, (xdrproc_t)xdr_gfx_fallocate_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5305,8 +5264,7 @@ client4_0_discard(call_frame_t *frame, xlator_t *this, void *data)
client4_0_discard_cbk, NULL,
(xdrproc_t)xdr_gfx_discard_req);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5348,8 +5306,7 @@ client4_0_zerofill(call_frame_t *frame, xlator_t *this, void *data)
client4_0_zerofill_cbk, NULL,
(xdrproc_t)xdr_gfx_zerofill_req);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5391,8 +5348,7 @@ client4_0_ipc(call_frame_t *frame, xlator_t *this, void *data)
client4_0_ipc_cbk, NULL,
(xdrproc_t)xdr_gfx_ipc_req);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5436,8 +5392,7 @@ client4_0_seek(call_frame_t *frame, xlator_t *this, void *data)
client4_0_seek_cbk, NULL,
(xdrproc_t)xdr_gfx_seek_req);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5485,8 +5440,7 @@ client4_0_getactivelk(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_GETACTIVELK, client4_0_getactivelk_cbk,
NULL, (xdrproc_t)xdr_gfx_getactivelk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5540,8 +5494,7 @@ client4_0_setactivelk(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_SETACTIVELK, client4_0_setactivelk_cbk,
NULL, (xdrproc_t)xdr_gfx_setactivelk_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
clnt_setactivelk_req_cleanup_v2(&req);
@@ -5585,8 +5538,8 @@ client4_rchecksum_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_rchecksum_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -5746,8 +5699,8 @@ client4_0_put_cbk(struct rpc_req *req, struct iovec *iov, int count,
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t)xdr_gfx_common_3iatt_rsp);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
- "XDR decoding failed");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_XDR_DECODING_FAILED,
+ NULL);
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -5811,8 +5764,7 @@ client4_0_namelink(call_frame_t *frame, xlator_t *this, void *data)
client4_namelink_cbk, NULL,
(xdrproc_t)xdr_gfx_namelink_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -5928,8 +5880,7 @@ client4_0_put(call_frame_t *frame, xlator_t *this, void *data)
* do the unwind for us (see rpc_clnt_submit), so don't unwind
* here in such cases.
*/
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
return 0;
@@ -5997,8 +5948,7 @@ client4_0_copy_file_range(call_frame_t *frame, xlator_t *this, void *data)
* do the unwind for us (see rpc_clnt_submit), so don't unwind
* here in such cases.
*/
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -6040,8 +5990,7 @@ client4_0_fsetattr(call_frame_t *frame, xlator_t *this, void *data)
client4_0_fsetattr_cbk, NULL,
(xdrproc_t)xdr_gfx_fsetattr_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
@@ -6086,8 +6035,7 @@ client4_0_rchecksum(call_frame_t *frame, xlator_t *this, void *data)
GFS3_OP_RCHECKSUM, client4_rchecksum_cbk, NULL,
(xdrproc_t)xdr_gfx_rchecksum_req);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
- "failed to send the fop");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED, NULL);
}
GF_FREE(req.xdata.pairs.pairs_val);
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index ee5a59962e2..0f31fea9511 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -221,18 +221,15 @@ client_submit_request(xlator_t *this, void *req, call_frame_t *frame,
if (cp && cp->iobref != NULL) {
ret = iobref_merge(new_iobref, cp->iobref);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_NO_MEMORY,
- "cannot merge "
- "iobref passed from caller into "
- "new_iobref");
+ gf_smsg(this->name, GF_LOG_WARNING, ENOMEM,
+ PC_MSG_MERGE_IOBREF_FAILED, NULL);
}
}
ret = iobref_add(new_iobref, iobuf);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_NO_MEMORY,
- "cannot add iobuf into "
- "iobref");
+ gf_smsg(this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_ADD_IOBUF_FAILED,
+ NULL);
goto out;
}
@@ -329,8 +326,8 @@ client_releasedir(xlator_t *this, fd_t *fd)
}
out:
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_DIR_OP_FAILED,
- "releasedir fop failed");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_RELEASE_DIR_OP_FAILED,
+ NULL);
return 0;
}
@@ -355,8 +352,7 @@ client_release(xlator_t *this, fd_t *fd)
}
out:
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_FILE_OP_FAILED,
- "release fop failed");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_FILE_OP_FAILED, NULL);
return 0;
}
@@ -1153,8 +1149,8 @@ client_set_remote_options(char *value, xlator_t *this)
}
ret = dict_set_dynstr_sizen(this->options, "remote-host", host_dup);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set remote-host with %s", host);
+ gf_smsg(this->name, GF_LOG_WARNING, 0,
+ PC_MSG_REMOTE_HOST_SET_FAILED, "host=%s", host, NULL);
GF_FREE(host_dup);
goto out;
}
@@ -1169,8 +1165,8 @@ client_set_remote_options(char *value, xlator_t *this)
ret = dict_set_dynstr_sizen(this->options, "remote-subvolume",
subvol_dup);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set remote-host with %s", host);
+ gf_smsg(this->name, GF_LOG_WARNING, 0,
+ PC_MSG_REMOTE_HOST_SET_FAILED, "host=%s", host, NULL);
GF_FREE(subvol_dup);
goto out;
}
@@ -1181,8 +1177,8 @@ client_set_remote_options(char *value, xlator_t *this)
ret = dict_set_int32_sizen(this->options, "remote-port", remote_port);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
- "failed to set remote-port to %d", remote_port);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_REMOTE_PORT_SET_FAILED,
+ "remote-port=%d", remote_port, NULL);
goto out;
}
}
@@ -1211,8 +1207,7 @@ client_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
if (is_client_rpc_init_command(dict, this, &value) == _gf_true) {
GF_ASSERT(value);
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_RPC_INIT,
- "client rpc init command");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_RPC_INIT, NULL);
ret = client_set_remote_options(value, this);
if (!ret) {
op_ret = 0;
@@ -1223,8 +1218,7 @@ client_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
}
if (is_client_rpc_destroy_command(dict, this) == _gf_true) {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_RPC_DESTROY,
- "client rpc destroy command");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_RPC_DESTROY, NULL);
ret = client_destroy_rpc(this);
if (ret) {
op_ret = 0;
@@ -2178,12 +2172,6 @@ client_mark_fd_bad(xlator_t *this)
pthread_spin_unlock(&conf->fd_lock);
}
-static int
-is_connection_to_brick(struct rpc_clnt *rpc)
-{
- return (rpc->conn.config.remote_port != 0);
-}
-
int
client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
void *data)
@@ -2195,9 +2183,8 @@ client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
this = mydata;
if (!this || !this->private) {
- gf_msg("client", GF_LOG_ERROR, EINVAL, PC_MSG_INVALID_ENTRY,
- (this != NULL) ? "private structure of the xlator is NULL"
- : "xlator is NULL");
+ gf_smsg("client", GF_LOG_ERROR, EINVAL, PC_MSG_XLATOR_NULL,
+ (this != NULL) ? "private structue" : "", NULL);
goto out;
}
@@ -2205,7 +2192,7 @@ client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
switch (event) {
case RPC_CLNT_PING: {
- if (is_connection_to_brick(rpc)) {
+ if (conf->connection_to_brick) {
ret = default_notify(this, GF_EVENT_CHILD_PING, data);
if (ret)
gf_log(this->name, GF_LOG_INFO, "CHILD_PING notify failed");
@@ -2221,10 +2208,8 @@ client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
ret = client_handshake(this, rpc);
if (ret)
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_HANDSHAKE_RETURN,
- "handshake "
- "msg returned %d",
- ret);
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_HANDSHAKE_RETURN,
+ "ret=%d", ret, NULL);
break;
}
case RPC_CLNT_DISCONNECT:
@@ -2235,13 +2220,9 @@ client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
if (!conf->skip_notify) {
if (conf->can_log_disconnect) {
if (!conf->disconnect_err_logged) {
- gf_msg(this->name, GF_LOG_INFO, 0,
- PC_MSG_CLIENT_DISCONNECTED,
- "disconnected from %s. Client "
- "process will keep trying to "
- "connect to glusterd until "
- "brick's port is available",
- conf->rpc->conn.name);
+ gf_smsg(this->name, GF_LOG_INFO, 0,
+ PC_MSG_CLIENT_DISCONNECTED, "conn-name=%s",
+ conf->rpc->conn.name, NULL);
} else {
gf_msg_debug(this->name, 0,
"disconnected from %s. "
@@ -2281,9 +2262,8 @@ client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
goto out;
}
if (ret)
- gf_msg(this->name, GF_LOG_INFO, 0,
- PC_MSG_CHILD_DOWN_NOTIFY_FAILED,
- "CHILD_DOWN notify failed");
+ gf_smsg(this->name, GF_LOG_INFO, 0,
+ PC_MSG_CHILD_DOWN_NOTIFY_FAILED, NULL);
} else {
if (conf->can_log_disconnect)
@@ -2296,11 +2276,13 @@ client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
conf->skip_notify = 0;
if (conf->quick_reconnect) {
+ conf->connection_to_brick = _gf_true;
conf->quick_reconnect = 0;
rpc_clnt_cleanup_and_start(rpc);
} else {
rpc->conn.config.remote_port = 0;
+ conf->connection_to_brick = _gf_false;
}
break;
case RPC_CLNT_DESTROY:
@@ -2330,18 +2312,14 @@ notify(xlator_t *this, int32_t event, void *data, ...)
switch (event) {
case GF_EVENT_PARENT_UP: {
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_PARENT_UP,
- "parent translators are ready, attempting connect "
- "on transport");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_PARENT_UP, NULL);
rpc_clnt_start(conf->rpc);
break;
}
case GF_EVENT_PARENT_DOWN:
- gf_msg(this->name, GF_LOG_INFO, 0, PC_MSG_PARENT_DOWN,
- "current graph is no longer active, destroying "
- "rpc_client ");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PC_MSG_PARENT_DOWN, NULL);
pthread_mutex_lock(&conf->lock);
{
@@ -2384,23 +2362,20 @@ client_check_remote_host(xlator_t *this, dict_t *options)
ret = dict_get_str_sizen(options, "remote-host", &remote_host);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, EINVAL, PC_MSG_DICT_GET_FAILED,
- "Remote host is not set. "
- "Assuming the volfile server as remote host");
+ gf_smsg(this->name, GF_LOG_INFO, EINVAL, PC_MSG_REMOTE_HOST_NOT_SET,
+ NULL);
if (!this->ctx->cmd_args.volfile_server) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_DICT_GET_FAILED,
- "No remote host to "
- "connect.");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_NOREMOTE_HOST,
+ NULL);
goto out;
}
ret = dict_set_str_sizen(options, "remote-host",
this->ctx->cmd_args.volfile_server);
if (ret == -1) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_GET_FAILED,
- "Failed to set the "
- "remote host");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_REMOTE_HOST_SET_FAILED,
+ NULL);
goto out;
}
}
@@ -2423,8 +2398,8 @@ build_client_config(xlator_t *this, clnt_conf_t *conf)
GF_OPTION_INIT("remote-subvolume", conf->opt.remote_subvolume, path, out);
if (!conf->opt.remote_subvolume)
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "option 'remote-subvolume' not given");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL,
+ PC_MSG_REMOTE_SUBVOL_NOT_GIVEN, NULL);
GF_OPTION_INIT("filter-O_DIRECT", conf->filter_o_direct, bool, out);
@@ -2455,8 +2430,7 @@ mem_acct_init(xlator_t *this)
ret = xlator_mem_acct_init(this, gf_client_mt_end + 1);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_ERROR, ENOMEM, PC_MSG_NO_MEMORY,
- "Memory accounting init failed");
+ gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, PC_MSG_NO_MEMORY, NULL);
return ret;
}
@@ -2483,9 +2457,7 @@ client_destroy_rpc(xlator_t *this)
goto out;
}
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_RPC_INVALID_CALL,
- "RPC destroy called on already destroyed "
- "connection");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_RPC_INVALID_CALL, NULL);
out:
return ret;
@@ -2500,24 +2472,20 @@ client_init_rpc(xlator_t *this)
conf = this->private;
if (conf->rpc) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PC_MSG_RPC_INITED_ALREADY,
- "client rpc already "
- "init'ed");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PC_MSG_RPC_INITED_ALREADY, NULL);
ret = -1;
goto out;
}
conf->rpc = rpc_clnt_new(this->options, this, this->name, 0);
if (!conf->rpc) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_INIT_FAILED,
- "failed to initialize RPC");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_INIT_FAILED, NULL);
goto out;
}
ret = rpc_clnt_register_notify(conf->rpc, client_rpc_notify, this);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_NOTIFY_FAILED,
- "failed to register notify");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_NOTIFY_FAILED, NULL);
goto out;
}
@@ -2526,8 +2494,7 @@ client_init_rpc(xlator_t *this)
ret = rpcclnt_cbk_program_register(conf->rpc, &gluster_cbk_prog, this);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_CBK_FAILED,
- "failed to register callback program");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_CBK_FAILED, NULL);
goto out;
}
@@ -2633,15 +2600,13 @@ init(xlator_t *this)
clnt_conf_t *conf = NULL;
if (this->children) {
- gf_msg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_INVALID_ENTRY,
- "FATAL: client protocol "
- "translator cannot have any subvolumes");
+ gf_smsg(this->name, GF_LOG_ERROR, EINVAL, PC_MSG_FATAL_CLIENT_PROTOCOL,
+ NULL);
goto out;
}
if (!this->parents) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_INVALID_ENTRY,
- "Volume is dangling. ");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PC_MSG_VOL_DANGLING, NULL);
}
conf = GF_CALLOC(1, sizeof(*conf), gf_client_mt_clnt_conf_t);
@@ -2686,8 +2651,8 @@ init(xlator_t *this)
this->local_pool = mem_pool_new(clnt_local_t, 64);
if (!this->local_pool) {
ret = -1;
- gf_msg(this->name, GF_LOG_ERROR, ENOMEM, PC_MSG_NO_MEMORY,
- "failed to create local_t's memory pool");
+ gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, PC_MSG_CREATE_MEM_POOL_FAILED,
+ NULL);
goto out;
}
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index 1f05fba444e..ab799c41755 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -63,10 +63,8 @@ typedef enum {
goto label; \
} \
if (remote_fd == -1) { \
- gf_msg(xl->name, GF_LOG_WARNING, EBADFD, PC_MSG_BAD_FD, \
- " (%s) " \
- "remote_fd is -1. EBADFD", \
- uuid_utoa(fd->inode->gfid)); \
+ gf_smsg(xl->name, GF_LOG_WARNING, EBADFD, PC_MSG_BAD_FD, \
+ "gfid=%s", uuid_utoa(fd->inode->gfid), NULL); \
op_errno = EBADFD; \
goto label; \
} \
@@ -159,6 +157,8 @@ typedef struct clnt_conf {
locks when a client disconnects.
*/
+ gf_boolean_t connection_to_brick; /*True from attempt to connect to brick
+ till disconnection to brick*/
} clnt_conf_t;
typedef struct _client_fd_ctx {
diff --git a/xlators/protocol/server/src/Makefile.am b/xlators/protocol/server/src/Makefile.am
index 01edbd35d9c..5e875c8df0b 100644
--- a/xlators/protocol/server/src/Makefile.am
+++ b/xlators/protocol/server/src/Makefile.am
@@ -4,11 +4,11 @@ endif
xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/protocol
-server_la_LDFLAGS = $(LIB_DL) -module $(GF_XLATOR_DEFAULT_LDFLAGS)
+server_la_LDFLAGS = -module $(GF_XLATOR_DEFAULT_LDFLAGS)
server_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
$(top_builddir)/rpc/rpc-lib/src/libgfrpc.la \
- $(top_builddir)/rpc/xdr/src/libgfxdr.la
+ $(top_builddir)/rpc/xdr/src/libgfxdr.la $(LIB_DL)
server_la_SOURCES = server.c server-resolve.c server-helpers.c \
server-rpc-fops.c server-handshake.c authenticate.c \
diff --git a/xlators/protocol/server/src/server-common.c b/xlators/protocol/server/src/server-common.c
index 4bb84042a9e..cd79cf4d930 100644
--- a/xlators/protocol/server/src/server-common.c
+++ b/xlators/protocol/server/src/server-common.c
@@ -828,7 +828,7 @@ server4_post_lease(gfx_lease_rsp *rsp, struct gf_lease *lease)
void
server4_post_link(server_state_t *state, gfx_common_3iatt_rsp *rsp,
inode_t *inode, struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata)
+ struct iatt *postparent)
{
inode_t *link_inode = NULL;
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 510dd09c268..6e644912a46 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -52,14 +52,14 @@ gid_resolve(server_conf_t *conf, call_stack_t *root)
ret = getpwuid_r(root->uid, &mypw, mystrs, sizeof(mystrs), &result);
if (ret != 0) {
- gf_msg("gid-cache", GF_LOG_ERROR, errno, PS_MSG_GET_UID_FAILED,
- "getpwuid_r(%u) failed", root->uid);
+ gf_smsg("gid-cache", GF_LOG_ERROR, errno, PS_MSG_GET_UID_FAILED,
+ "uid=%u", root->uid, NULL);
return -1;
}
if (!result) {
- gf_msg("gid-cache", GF_LOG_ERROR, 0, PS_MSG_UID_NOT_FOUND,
- "getpwuid_r(%u) found nothing", root->uid);
+ gf_smsg("gid-cache", GF_LOG_ERROR, 0, PS_MSG_UID_NOT_FOUND, "uid=%u",
+ root->uid, NULL);
return -1;
}
@@ -67,9 +67,9 @@ gid_resolve(server_conf_t *conf, call_stack_t *root)
ngroups = gf_getgrouplist(result->pw_name, root->gid, &mygroups);
if (ngroups == -1) {
- gf_msg("gid-cache", GF_LOG_ERROR, 0, PS_MSG_MAPPING_ERROR,
- "could not map %s to group list (%d gids)", result->pw_name,
- root->ngrps);
+ gf_smsg("gid-cache", GF_LOG_ERROR, 0, PS_MSG_MAPPING_ERROR,
+ "pw_name=%s", result->pw_name, "root->ngtps=%d", root->ngrps,
+ NULL);
return -1;
}
root->ngrps = (uint16_t)ngroups;
@@ -313,13 +313,12 @@ do_fd_cleanup(xlator_t *this, client_t *client, fdentry_t *fdentries,
ret = inode_path(fd->inode, NULL, &path);
if (ret > 0) {
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_FD_CLEANUP,
- "fd cleanup on %s", path);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_FD_CLEANUP,
+ "path=%s", path, NULL);
GF_FREE(path);
} else {
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_FD_CLEANUP,
- "fd cleanup on inode with gfid %s",
- uuid_utoa(fd->inode->gfid));
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_FD_CLEANUP,
+ "inode-gfid=%s", uuid_utoa(fd->inode->gfid), NULL);
}
tmp_frame->local = fd;
@@ -363,9 +362,7 @@ server_connection_cleanup(xlator_t *this, client_t *client, int32_t flags,
serv_ctx = server_ctx_get(client, client->this);
if (serv_ctx == NULL) {
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
- "server_ctx_get() "
- "failed");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED, NULL);
goto out;
}
@@ -413,8 +410,7 @@ server_connection_cleanup(xlator_t *this, client_t *client, int32_t flags,
fd_count);
ret = do_fd_cleanup(this, client, fdentries, fd_count, detach);
} else
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_FDENTRY_NULL,
- "no fdentries to clean");
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_FDENTRY_NULL, NULL);
if (cd_ret || ret)
ret = -1;
@@ -598,9 +594,8 @@ server_build_config(xlator_t *this, server_conf_t *conf)
if (data) {
ret = gf_string2boolean(data->data, &conf->verify_volfile);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
- "wrong value for '"
- "verify-volfile-checksum', Neglecting option");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_WRONG_VALUE,
+ NULL);
}
}
@@ -608,9 +603,8 @@ server_build_config(xlator_t *this, server_conf_t *conf)
if (data) {
ret = gf_string2boolean(data->data, &conf->trace);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
- "'trace' takes on only "
- "boolean values. Neglecting option");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
+ NULL);
}
}
@@ -631,18 +625,16 @@ server_build_config(xlator_t *this, server_conf_t *conf)
or directory specified is non standard */
ret = sys_stat(data->data, &buf);
if ((ret != 0) || !S_ISDIR(buf.st_mode)) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_DIR_NOT_FOUND,
- "Directory '%s' doesn't "
- "exist, exiting.",
- data->data);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_DIR_NOT_FOUND,
+ "data=%s", data->data, NULL);
ret = -1;
goto out;
}
/* Make sure that conf-dir doesn't contain ".." in path */
if ((gf_strstr(data->data, "/", "..")) == -1) {
ret = -1;
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_CONF_DIR_INVALID,
- "%s: invalid conf_dir", data->data);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_CONF_DIR_INVALID,
+ "data=%s", data->data, NULL);
goto out;
}
@@ -824,8 +816,9 @@ server_print_reply(call_frame_t *frame, int op_ret, int op_errno)
if (state->fd)
snprintf(fdstr, 32, " fd=%p", state->fd);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_MSG,
- "%s%s => (%d, %d)%s", op, caller, op_ret, op_errno, fdstr);
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_MSG, "op=%s", op,
+ "caller=%s", caller, "op_ret=%d", op_ret, "op_errno=%d", op_errno,
+ "fdstr=%s", fdstr, NULL);
out:
return;
}
@@ -885,9 +878,10 @@ server_print_request(call_frame_t *frame)
break;
}
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_SERVER_MSG, "%s%s%s%s%s%s%s", op,
- caller, resolve_vars, loc_vars, resolve2_vars, loc2_vars,
- other_vars);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_SERVER_MSG, "op=%s", op,
+ "caller=%s", caller, "resolve_vars=%s", resolve_vars, "loc_vars=%s",
+ loc_vars, "resolve2_vars=%s", resolve2_vars, "loc2_vars=%s",
+ loc2_vars, "other_vars=%s", other_vars, NULL);
out:
return;
}
@@ -923,8 +917,8 @@ serialize_rsp_direntp(gf_dirent_t *entries, gfs3_readdirp_rsp *rsp)
(char **)&trav->dict.dict_val,
&trav->dict.dict_len);
if (ret != 0) {
- gf_msg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_DICT_SERIALIZE_FAIL,
- "failed to serialize reply dict");
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_DICT_SERIALIZE_FAIL,
+ NULL);
errno = -ret;
trav->dict.dict_len = 0;
goto out;
@@ -1155,8 +1149,8 @@ common_rsp_locklist(lock_migration_info_t *locklist, gfs3_locklist **reply)
break;
default:
- gf_msg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_LOCK_ERROR,
- "Unknown lock type: %" PRId32 "!", tmp->flock.l_type);
+ gf_smsg(THIS->name, GF_LOG_ERROR, 0, PS_MSG_LOCK_ERROR,
+ "lock_type=%" PRId32, tmp->flock.l_type, NULL);
break;
}
@@ -1255,8 +1249,9 @@ gf_server_check_getxattr_cmd(call_frame_t *frame, const char *key)
{
list_for_each_entry(xprt, &conf->xprt_list, list)
{
- gf_msg("mount-point-list", GF_LOG_INFO, 0, PS_MSG_MOUNT_PT_FAIL,
- "%s", xprt->peerinfo.identifier);
+ gf_smsg("mount-point-list", GF_LOG_INFO, 0,
+ PS_MSG_MOUNT_PT_FAIL, "identifier=%s",
+ xprt->peerinfo.identifier, NULL);
}
}
pthread_mutex_unlock(&conf->mutex);
@@ -1286,9 +1281,8 @@ gf_server_check_setxattr_cmd(call_frame_t *frame, dict_t *dict)
total_read += xprt->total_bytes_read;
total_write += xprt->total_bytes_write;
}
- gf_msg("stats", GF_LOG_INFO, 0, PS_MSG_RW_STAT,
- "total-read %" PRIu64 ", total-write %" PRIu64, total_read,
- total_write);
+ gf_smsg("stats", GF_LOG_INFO, 0, PS_MSG_RW_STAT, "total-read=%" PRIu64,
+ total_read, "total-write=%" PRIu64, total_write, NULL);
}
return 0;
@@ -1364,15 +1358,15 @@ auth_set_username_passwd(dict_t *input_params, dict_t *config_params,
ret = dict_get_str(input_params, "password", &password);
if (ret) {
- gf_msg("auth/login", GF_LOG_WARNING, 0, PS_MSG_DICT_GET_FAILED,
- "password not found, returning DONT-CARE");
+ gf_smsg("auth/login", GF_LOG_WARNING, 0, PS_MSG_PASSWORD_NOT_FOUND,
+ NULL);
goto out;
}
ret = dict_get_str(input_params, "remote-subvolume", &brick_name);
if (ret) {
- gf_msg("auth/login", GF_LOG_ERROR, 0, PS_MSG_DICT_GET_FAILED,
- "remote-subvolume not specified");
+ gf_smsg("auth/login", GF_LOG_ERROR, 0,
+ PS_MSG_REMOTE_SUBVOL_NOT_SPECIFIED, NULL);
ret = -1;
goto out;
}
@@ -1404,10 +1398,8 @@ auth_set_username_passwd(dict_t *input_params, dict_t *config_params,
GF_FREE(searchstr);
if (!passwd_data) {
- gf_msg("auth/login", GF_LOG_ERROR, 0, PS_MSG_LOGIN_ERROR,
- "wrong "
- "username/password "
- "combination");
+ gf_smsg("auth/login", GF_LOG_ERROR, 0, PS_MSG_LOGIN_ERROR,
+ NULL);
ret = -1;
goto out;
}
@@ -1417,10 +1409,8 @@ auth_set_username_passwd(dict_t *input_params, dict_t *config_params,
client->auth.username = gf_strdup(username);
client->auth.passwd = gf_strdup(password);
} else {
- gf_msg("auth/login", GF_LOG_ERROR, 0, PS_MSG_LOGIN_ERROR,
- "wrong "
- "password for user %s",
- username);
+ gf_smsg("auth/login", GF_LOG_ERROR, 0, PS_MSG_LOGIN_ERROR,
+ "username=%s", username, NULL);
}
break;
}
@@ -1457,7 +1447,7 @@ unserialize_req_locklist(gfs3_setactivelk_req *req, lock_migration_info_t *lmi)
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, PS_MSG_NO_MEM, NULL);
goto out;
}
@@ -1494,7 +1484,7 @@ unserialize_req_locklist_v2(gfx_setactivelk_req *req,
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, PS_MSG_NO_MEM, NULL);
goto out;
}
diff --git a/xlators/protocol/server/src/server-messages.h b/xlators/protocol/server/src/server-messages.h
index 9f00421fe92..1b2e149cb7d 100644
--- a/xlators/protocol/server/src/server-messages.h
+++ b/xlators/protocol/server/src/server-messages.h
@@ -23,43 +23,146 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(PS, PS_MSG_AUTHENTICATE_ERROR, PS_MSG_VOL_VALIDATE_FAILED,
- PS_MSG_AUTH_INIT_FAILED, PS_MSG_REMOTE_CLIENT_REFUSED,
- PS_MSG_GFID_RESOLVE_FAILED, PS_MSG_ANONYMOUS_FD_CREATE_FAILED,
- PS_MSG_NO_MEMORY, PS_MSG_FD_NOT_FOUND, PS_MSG_INVALID_ENTRY,
- PS_MSG_GET_UID_FAILED, PS_MSG_UID_NOT_FOUND, PS_MSG_MAPPING_ERROR,
- PS_MSG_FD_CLEANUP, PS_MSG_SERVER_CTX_GET_FAILED, PS_MSG_FDENTRY_NULL,
- PS_MSG_DIR_NOT_FOUND, PS_MSG_SERVER_MSG, PS_MSG_DICT_SERIALIZE_FAIL,
- PS_MSG_RW_STAT, PS_MSG_DICT_GET_FAILED, PS_MSG_LOGIN_ERROR,
- PS_MSG_REMOUNT_CLIENT_REQD, PS_MSG_DEFAULTING_FILE,
- PS_MSG_VOL_FILE_OPEN_FAILED, PS_MSG_STAT_ERROR,
- PS_MSG_SSL_NAME_SET_FAILED, PS_MSG_ASPRINTF_FAILED,
- PS_MSG_CLIENT_VERSION_NOT_SET, PS_MSG_CLIENT_ACCEPTED,
- PS_MSG_CLIENT_LK_VERSION_ERROR, PS_MSG_GRACE_TIMER_EXPD,
- PS_MSG_SERIALIZE_REPLY_FAILED, PS_MSG_AUTH_IP_ERROR,
- PS_MSG_SKIP_FORMAT_CHK, PS_MSG_INTERNET_ADDR_ERROR,
- PS_MSG_CLIENT_DISCONNECTING, PS_MSG_GRACE_TIMER_START,
- PS_MSG_STATEDUMP_PATH_ERROR, PS_MSG_GRP_CACHE_ERROR,
- PS_MSG_RPC_CONF_ERROR, PS_MSG_TRANSPORT_ERROR, PS_MSG_SUBVOL_NULL,
- PS_MSG_PARENT_VOL_ERROR, PS_MSG_RPCSVC_CREATE_FAILED,
- PS_MSG_RPCSVC_LISTENER_CREATE_FAILED, PS_MSG_RPCSVC_NOTIFY,
- PS_MSG_PGM_REG_FAILED, PS_MSG_ULIMIT_SET_FAILED, PS_MSG_STATFS,
- PS_MSG_LOOKUP_INFO, PS_MSG_LK_INFO, PS_MSG_LOCK_ERROR,
- PS_MSG_INODELK_INFO, PS_MSG_ENTRYLK_INFO, PS_MSG_ACCESS_INFO,
- PS_MSG_DIR_INFO, PS_MSG_MKNOD_INFO, PS_MSG_REMOVEXATTR_INFO,
- PS_MSG_GETXATTR_INFO, PS_MSG_SETXATTR_INFO, PS_MSG_RENAME_INFO,
- PS_MSG_LINK_INFO, PS_MSG_TRUNCATE_INFO, PS_MSG_FSTAT_INFO,
- PS_MSG_FLUSH_INFO, PS_MSG_SYNC_INFO, PS_MSG_WRITE_INFO,
- PS_MSG_READ_INFO, PS_MSG_CHKSUM_INFO, PS_MSG_OPEN_INFO,
- PS_MSG_CREATE_INFO, PS_MSG_SETATTR_INFO, PS_MSG_XATTROP_INFO,
- PS_MSG_ALLOC_INFO, PS_MSG_DISCARD_INFO, PS_MSG_ZEROFILL_INFO,
- PS_MSG_FD_CREATE_FAILED, PS_MSG_WRONG_STATE, PS_MSG_CONF_DIR_INVALID,
- PS_MSG_MOUNT_PT_FAIL, PS_MSG_STAT_INFO, PS_MSG_FILE_OP_FAILED,
- PS_MSG_GRACE_TIMER_CANCELLED, PS_MSG_ENCODE_MSG_FAILED,
- PS_MSG_REPLY_SUBMIT_FAILED, PS_MSG_RPC_NOTIFY_ERROR,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED, PS_MSG_SERVER_IPC_INFO,
- PS_MSG_SEEK_INFO, PS_MSG_COMPOUND_INFO,
- PS_MSG_CLIENT_OPVERSION_GET_FAILED, PS_MSG_CHILD_STATUS_FAILED,
- PS_MSG_PUT_INFO);
+GLFS_MSGID(
+ PS, PS_MSG_AUTHENTICATE_ERROR, PS_MSG_VOL_VALIDATE_FAILED,
+ PS_MSG_AUTH_INIT_FAILED, PS_MSG_REMOTE_CLIENT_REFUSED,
+ PS_MSG_GFID_RESOLVE_FAILED, PS_MSG_ANONYMOUS_FD_CREATE_FAILED,
+ PS_MSG_NO_MEMORY, PS_MSG_FD_NOT_FOUND, PS_MSG_INVALID_ENTRY,
+ PS_MSG_GET_UID_FAILED, PS_MSG_UID_NOT_FOUND, PS_MSG_MAPPING_ERROR,
+ PS_MSG_FD_CLEANUP, PS_MSG_SERVER_CTX_GET_FAILED, PS_MSG_FDENTRY_NULL,
+ PS_MSG_DIR_NOT_FOUND, PS_MSG_SERVER_MSG, PS_MSG_DICT_SERIALIZE_FAIL,
+ PS_MSG_RW_STAT, PS_MSG_DICT_GET_FAILED, PS_MSG_LOGIN_ERROR,
+ PS_MSG_REMOUNT_CLIENT_REQD, PS_MSG_DEFAULTING_FILE,
+ PS_MSG_VOL_FILE_OPEN_FAILED, PS_MSG_STAT_ERROR, PS_MSG_SSL_NAME_SET_FAILED,
+ PS_MSG_ASPRINTF_FAILED, PS_MSG_CLIENT_VERSION_NOT_SET,
+ PS_MSG_CLIENT_ACCEPTED, PS_MSG_CLIENT_LK_VERSION_ERROR,
+ PS_MSG_GRACE_TIMER_EXPD, PS_MSG_SERIALIZE_REPLY_FAILED,
+ PS_MSG_AUTH_IP_ERROR, PS_MSG_SKIP_FORMAT_CHK, PS_MSG_INTERNET_ADDR_ERROR,
+ PS_MSG_CLIENT_DISCONNECTING, PS_MSG_GRACE_TIMER_START,
+ PS_MSG_STATEDUMP_PATH_ERROR, PS_MSG_GRP_CACHE_ERROR, PS_MSG_RPC_CONF_ERROR,
+ PS_MSG_TRANSPORT_ERROR, PS_MSG_SUBVOL_NULL, PS_MSG_PARENT_VOL_ERROR,
+ PS_MSG_RPCSVC_CREATE_FAILED, PS_MSG_RPCSVC_LISTENER_CREATE_FAILED,
+ PS_MSG_RPCSVC_NOTIFY, PS_MSG_PGM_REG_FAILED, PS_MSG_ULIMIT_SET_FAILED,
+ PS_MSG_STATFS, PS_MSG_LOOKUP_INFO, PS_MSG_LK_INFO, PS_MSG_LOCK_ERROR,
+ PS_MSG_INODELK_INFO, PS_MSG_ENTRYLK_INFO, PS_MSG_ACCESS_INFO,
+ PS_MSG_DIR_INFO, PS_MSG_MKNOD_INFO, PS_MSG_REMOVEXATTR_INFO,
+ PS_MSG_GETXATTR_INFO, PS_MSG_SETXATTR_INFO, PS_MSG_RENAME_INFO,
+ PS_MSG_LINK_INFO, PS_MSG_TRUNCATE_INFO, PS_MSG_FSTAT_INFO,
+ PS_MSG_FLUSH_INFO, PS_MSG_SYNC_INFO, PS_MSG_WRITE_INFO, PS_MSG_READ_INFO,
+ PS_MSG_CHKSUM_INFO, PS_MSG_OPEN_INFO, PS_MSG_CREATE_INFO,
+ PS_MSG_SETATTR_INFO, PS_MSG_XATTROP_INFO, PS_MSG_ALLOC_INFO,
+ PS_MSG_DISCARD_INFO, PS_MSG_ZEROFILL_INFO, PS_MSG_FD_CREATE_FAILED,
+ PS_MSG_WRONG_STATE, PS_MSG_CONF_DIR_INVALID, PS_MSG_MOUNT_PT_FAIL,
+ PS_MSG_STAT_INFO, PS_MSG_FILE_OP_FAILED, PS_MSG_GRACE_TIMER_CANCELLED,
+ PS_MSG_ENCODE_MSG_FAILED, PS_MSG_REPLY_SUBMIT_FAILED,
+ PS_MSG_RPC_NOTIFY_ERROR, PS_MSG_SERVER_EVENT_UPCALL_FAILED,
+ PS_MSG_SERVER_IPC_INFO, PS_MSG_SEEK_INFO, PS_MSG_COMPOUND_INFO,
+ PS_MSG_CLIENT_OPVERSION_GET_FAILED, PS_MSG_CHILD_STATUS_FAILED,
+ PS_MSG_PUT_INFO, PS_MSG_UNAUTHORIZED_CLIENT, PS_MSG_RECONFIGURE_FAILED,
+ PS_MSG_SET_STATEDUMP_PATH_ERROR, PS_MSG_INIT_GRP_CACHE_ERROR,
+ PS_MSG_RPC_CONFIGURE_FAILED, PS_MSG_TRANSPORT_TYPE_NOT_SET,
+ PS_MSG_GET_TOTAL_AVAIL_TRANSPORT_FAILED, PS_MSG_INVLAID_UPCALL_EVENT,
+ PS_MSG_SERVER_CHILD_EVENT_FAILED, PS_MSG_SETACTIVELK_INFO,
+ PS_MSG_GETACTIVELK_INFO, PS_MSG_WRONG_VALUE, PS_MSG_PASSWORD_NOT_FOUND,
+ PS_MSG_REMOTE_SUBVOL_NOT_SPECIFIED, PS_MSG_NO_MEM);
+#define PS_MSG_SERIALIZE_REPLY_FAILED_STR "Failed to serialize reply"
+#define PS_MSG_AUTH_IP_ERROR_STR "assuming 'auth.ip' to be 'auth.addr'"
+#define PS_MSG_SKIP_FORMAT_CHK_STR "skip format check for non-addr auth option"
+#define PS_MSG_INTERNET_ADDR_ERROR_STR \
+ "internet address does not confirm to standards"
+#define PS_MSG_AUTHENTICATE_ERROR_STR \
+ "volume defined as subvolume, but no authentication defined for the same"
+#define PS_MSG_CLIENT_DISCONNECTING_STR "disconnecting connection"
+#define PS_MSG_DICT_GET_FAILED_STR "failed to get"
+#define PS_MSG_NO_MEMORY_STR "Memory accounting init failed"
+#define PS_MSG_INVALID_ENTRY_STR \
+ "'trace' takes on only boolean values. Neglecting option"
+#define PS_MSG_STATEDUMP_PATH_ERROR_STR \
+ "Error while reconfiguring statedump path"
+#define PS_MSG_GRP_CACHE_ERROR_STR "Failed to reconfigure group cache."
+#define PS_MSG_RPC_CONF_ERROR_STR "No rpc_conf !!!!"
+#define PS_MSG_CLIENT_ACCEPTED_STR \
+ "authorized client, hence we continue with this connection"
+#define PS_MSG_UNAUTHORIZED_CLIENT_STR \
+ "unauthorized client, hence terminating the connection"
+#define PS_MSG_RECONFIGURE_FAILED_STR \
+ "Failed to reconfigure outstanding-rpc-limit"
+#define PS_MSG_TRANSPORT_ERROR_STR "Reconfigure not found for transport"
+#define PS_MSG_SUBVOL_NULL_STR "protocol/server should have subvolume"
+#define PS_MSG_PARENT_VOL_ERROR_STR \
+ "protocol/server should not have parent volumes"
+#define PS_MSG_SET_STATEDUMP_PATH_ERROR_STR "Error setting statedump path"
+#define PS_MSG_INIT_GRP_CACHE_ERROR_STR "Failed to initialize group cache."
+#define PS_MSG_RPCSVC_CREATE_FAILED_STR "creation of rpcsvc failed"
+#define PS_MSG_RPC_CONFIGURE_FAILED_STR \
+ "Failed to configure outstanding-rpc-limit"
+#define PS_MSG_TRANSPORT_TYPE_NOT_SET_STR "option transport-type not set"
+#define PS_MSG_GET_TOTAL_AVAIL_TRANSPORT_FAILED_STR \
+ "failed to get total number of available tranpsorts"
+#define PS_MSG_RPCSVC_LISTENER_CREATE_FAILED_STR "creation of listener failed"
+#define PS_MSG_RPCSVC_NOTIFY_STR "registration of notify with rpcsvc failed"
+#define PS_MSG_PGM_REG_FAILED_STR "registration of program failed"
+#define PS_MSG_ULIMIT_SET_FAILED_STR "WARNING: Failed to set 'ulimit -n 1M'"
+#define PS_MSG_FD_NOT_FOUND_STR "Failed to set max open fd to 64k"
+#define PS_MSG_VOL_FILE_OPEN_FAILED_STR \
+ "volfile-id argument not given. This is mandatory argument, defaulting " \
+ "to 'gluster'"
+#define PS_MSG_INVLAID_UPCALL_EVENT_STR "Received invalid upcall event"
+#define PS_MSG_CHILD_STATUS_FAILED_STR "No xlator is found in child status list"
+#define PS_MSG_SERVER_EVENT_UPCALL_FAILED_STR \
+ "server_process_event_upcall failed"
+#define PS_MSG_SERVER_CHILD_EVENT_FAILED_STR "server_process_child_event failed"
+#define PS_MSG_STATFS_STR "STATFS"
+#define PS_MSG_LOOKUP_INFO_STR "LOOKUP info"
+#define PS_MSG_LK_INFO_STR "LEASE info"
+#define PS_MSG_INODELK_INFO_STR "INODELK info"
+#define PS_MSG_DIR_INFO_STR "MKDIR info"
+#define PS_MSG_MKNOD_INFO_STR "MKNOD info"
+#define PS_MSG_REMOVEXATTR_INFO_STR "REMOVEXATTR info"
+#define PS_MSG_GETXATTR_INFO_STR "GETXATTR info"
+#define PS_MSG_SETXATTR_INFO_STR "SETXATTR info"
+#define PS_MSG_RENAME_INFO_STR "RENAME inf"
+#define PS_MSG_LINK_INFO_STR "LINK info"
+#define PS_MSG_TRUNCATE_INFO_STR "TRUNCATE info"
+#define PS_MSG_STAT_INFO_STR "STAT info"
+#define PS_MSG_FLUSH_INFO_STR "FLUSH info"
+#define PS_MSG_SYNC_INFO_STR "SYNC info"
+#define PS_MSG_WRITE_INFO_STR "WRITE info"
+#define PS_MSG_READ_INFO_STR "READ info"
+#define PS_MSG_CHKSUM_INFO_STR "CHKSUM info"
+#define PS_MSG_OPEN_INFO_STR "OPEN info"
+#define PS_MSG_XATTROP_INFO_STR "XATTROP info"
+#define PS_MSG_ALLOC_INFO_STR "ALLOC info"
+#define PS_MSG_DISCARD_INFO_STR "DISCARD info"
+#define PS_MSG_ZEROFILL_INFO_STR "ZEROFILL info"
+#define PS_MSG_SERVER_IPC_INFO_STR "IPC info"
+#define PS_MSG_SEEK_INFO_STR "SEEK info"
+#define PS_MSG_SETACTIVELK_INFO_STR "SETACTIVELK info"
+#define PS_MSG_CREATE_INFO_STR "CREATE info"
+#define PS_MSG_PUT_INFO_STR "PUT info"
+#define PS_MSG_FD_CREATE_FAILED_STR "could not create the fd"
+#define PS_MSG_GETACTIVELK_INFO_STR "GETACTIVELK info"
+#define PS_MSG_ENTRYLK_INFO_STR "ENTRYLK info"
+#define PS_MSG_ACCESS_INFO_STR "ACCESS info"
+#define PS_MSG_SETATTR_INFO_STR "SETATTR info"
+#define PS_MSG_SERVER_CTX_GET_FAILED_STR "server_ctx_get() failed"
+#define PS_MSG_LOCK_ERROR_STR "Unknown lock type"
+#define PS_MSG_GET_UID_FAILED_STR "getpwuid_r failed"
+#define PS_MSG_UID_NOT_FOUND_STR "getpwuid_r found nothing"
+#define PS_MSG_MAPPING_ERROR_STR "could not map to group list"
+#define PS_MSG_FD_CLEANUP_STR "fd cleanup"
+#define PS_MSG_FDENTRY_NULL_STR "no fdentry to clean"
+#define PS_MSG_WRONG_VALUE_STR \
+ "wrong value for 'verify-volfile-checksum', Neglecting option"
+#define PS_MSG_DIR_NOT_FOUND_STR "Directory doesnot exist"
+#define PS_MSG_CONF_DIR_INVALID_STR "invalid conf_dir"
+#define PS_MSG_SERVER_MSG_STR "server msg"
+#define PS_MSG_DICT_SERIALIZE_FAIL_STR "failed to serialize reply dict"
+#define PS_MSG_MOUNT_PT_FAIL_STR "mount point fail"
+#define PS_MSG_RW_STAT_STR "stat"
+#define PS_MSG_PASSWORD_NOT_FOUND_STR "password not found, returning DONT-CARE"
+#define PS_MSG_REMOTE_SUBVOL_NOT_SPECIFIED_STR "remote-subvolume not specified"
+#define PS_MSG_LOGIN_ERROR_STR "wrong password for user"
+#define PS_MSG_NO_MEM_STR "No memory"
#endif /* !_PS_MESSAGES_H__ */
diff --git a/xlators/protocol/server/src/server-rpc-fops_v2.c b/xlators/protocol/server/src/server-rpc-fops_v2.c
index ec0769873a9..c267f8f7832 100644
--- a/xlators/protocol/server/src/server-rpc-fops_v2.c
+++ b/xlators/protocol/server/src/server-rpc-fops_v2.c
@@ -56,10 +56,10 @@ server4_statfs_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
dict_to_xdr(xdata, &rsp.xdata);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_WARNING, op_errno, PS_MSG_STATFS,
- "%" PRId64 ": STATFS, client: %s, error-xlator: %s",
- frame->root->unique, STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_WARNING, op_errno, PS_MSG_STATFS,
+ "frame=%" PRId64, frame->root->unique, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -146,25 +146,20 @@ out:
if (op_ret) {
if (state->resolve.bname) {
- gf_msg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno), op_errno,
- PS_MSG_LOOKUP_INFO,
- "%" PRId64
- ": LOOKUP %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno),
+ op_errno, PS_MSG_LOOKUP_INFO, "frame=%" PRId64,
+ frame->root->unique, "path=%s", state->loc.path,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.pargfid),
+ "bname=%s", state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
} else {
- gf_msg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno), op_errno,
- PS_MSG_LOOKUP_INFO,
- "%" PRId64
- ": LOOKUP %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid),
- STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_LOOKUP, op_errno),
+ op_errno, PS_MSG_LOOKUP_INFO, "frame=%" PRId64,
+ frame->root->unique, "path=%s", state->loc.path,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
}
}
@@ -192,12 +187,12 @@ server4_lease_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_LEASE, op_errno), op_errno,
- PS_MSG_LK_INFO,
- "%" PRId64 ": LEASE %s (%s), client: %s, error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_LEASE, op_errno), op_errno,
+ PS_MSG_LK_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
}
server4_post_lease(&rsp, lease);
@@ -228,14 +223,12 @@ server4_lk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_LK, op_errno), op_errno,
- PS_MSG_LK_INFO,
- "%" PRId64 ": LK %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_LK, op_errno), op_errno,
+ PS_MSG_LK_INFO, "frame=%" PRId64, frame->root->unique,
+ "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -268,14 +261,12 @@ server4_inodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_INODELK, op_errno), op_errno,
- PS_MSG_INODELK_INFO,
- "%" PRId64
- ": INODELK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_INODELK, op_errno), op_errno,
+ PS_MSG_INODELK_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -307,14 +298,12 @@ server4_finodelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_FINODELK, op_errno), op_errno,
- PS_MSG_INODELK_INFO,
- "%" PRId64 ": FINODELK %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FINODELK, op_errno), op_errno,
+ PS_MSG_INODELK_INFO, "frame=%" PRId64, frame->root->unique,
+ "FINODELK_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -346,14 +335,12 @@ server4_entrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_ENTRYLK, op_errno), op_errno,
- PS_MSG_ENTRYLK_INFO,
- "%" PRId64
- ": ENTRYLK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_ENTRYLK, op_errno), op_errno,
+ PS_MSG_ENTRYLK_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -385,14 +372,12 @@ server4_fentrylk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_FENTRYLK, op_errno), op_errno,
- PS_MSG_ENTRYLK_INFO,
- "%" PRId64 ": FENTRYLK %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FENTRYLK, op_errno), op_errno,
+ PS_MSG_ENTRYLK_INFO, "frame=%" PRId64, frame->root->unique,
+ "FENTRYLK_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -423,13 +408,12 @@ server4_access_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_ACCESS_INFO,
- "%" PRId64
- ": ACCESS %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_ACCESS_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s",
+ (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -462,13 +446,13 @@ server4_rmdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_DIR_INFO,
- "%" PRId64
- ": RMDIR %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_DIR_INFO,
+ "frame=%" PRId64, frame->root->unique, "RMDIR_pat=%s",
+ (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s",
+ uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -504,14 +488,13 @@ server4_mkdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_MKDIR, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64
- ": MKDIR %s (%s/%s) client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_MKDIR, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "MKDIR_path=%s", (state->loc.path) ? state->loc.path : "",
+ "uuid_utoa=%s", uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -546,14 +529,13 @@ server4_mknod_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, fop_log_level(GF_FOP_MKNOD, op_errno), op_errno,
- PS_MSG_MKNOD_INFO,
- "%" PRId64
- ": MKNOD %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_MKNOD, op_errno), op_errno,
+ PS_MSG_MKNOD_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -585,14 +567,12 @@ server4_fsyncdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FSYNCDIR, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64 ": FSYNCDIR %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FSYNCDIR, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "FSYNCDIR_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -625,14 +605,12 @@ server4_readdir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_READDIR, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64 ": READDIR %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_READDIR, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "READDIR_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -676,14 +654,12 @@ server4_opendir_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_OPENDIR, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64
- ": OPENDIR %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_OPENDIR, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "OPENDIR_path=%s", (state->loc.path) ? state->loc.path : "",
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -725,13 +701,12 @@ server4_removexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
else
loglevel = GF_LOG_INFO;
- gf_msg(this->name, loglevel, op_errno, PS_MSG_REMOVEXATTR_INFO,
- "%" PRId64
- ": REMOVEXATTR %s (%s) of key %s, client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), state->name,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, loglevel, op_errno, PS_MSG_REMOVEXATTR_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s",
+ state->loc.path, "uuid_utoa=%s", uuid_utoa(state->resolve.gfid),
+ "name=%s", state->name, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -762,14 +737,13 @@ server4_fremovexattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FREMOVEXATTR, op_errno),
- op_errno, PS_MSG_REMOVEXATTR_INFO,
- "%" PRId64 ": FREMOVEXATTR %" PRId64
- " (%s) (%s), "
- "client: %s, error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), state->name,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FREMOVEXATTR, op_errno),
+ op_errno, PS_MSG_REMOVEXATTR_INFO, "frame=%" PRId64,
+ frame->root->unique, "FREMOVEXATTR_fd_no%" PRId64,
+ state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "name=%s", state->name,
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -801,14 +775,12 @@ server4_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_GETXATTR, op_errno), op_errno,
- PS_MSG_GETXATTR_INFO,
- "%" PRId64
- ": GETXATTR %s (%s) (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), state->name,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_GETXATTR, op_errno), op_errno,
+ PS_MSG_GETXATTR_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "name=%s", state->name,
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -843,14 +815,12 @@ server4_fgetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FGETXATTR, op_errno), op_errno,
- PS_MSG_GETXATTR_INFO,
- "%" PRId64 ": FGETXATTR %" PRId64
- " (%s) (%s), "
- "client: %s, error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), state->name,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FGETXATTR, op_errno), op_errno,
+ PS_MSG_GETXATTR_INFO, "frame=%" PRId64, frame->root->unique,
+ "FGETXATTR_fd_no=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "name=%s",
+ state->name, "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -890,11 +860,9 @@ server4_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_errno == ENOTSUP) {
gf_msg_debug(THIS->name, 0, "%s", strerror(op_errno));
} else {
- gf_msg(THIS->name, GF_LOG_INFO, op_errno, PS_MSG_SETXATTR_INFO,
- "client: %s, "
- "error-xlator: %s",
- STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(THIS->name, GF_LOG_INFO, op_errno, PS_MSG_SETXATTR_INFO,
+ "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
}
goto out;
}
@@ -932,11 +900,9 @@ server4_fsetxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_errno == ENOTSUP) {
gf_msg_debug(THIS->name, 0, "%s", strerror(op_errno));
} else {
- gf_msg(THIS->name, GF_LOG_INFO, op_errno, PS_MSG_SETXATTR_INFO,
- "client: %s, "
- "error-xlator: %s",
- STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(THIS->name, GF_LOG_INFO, op_errno, PS_MSG_SETXATTR_INFO,
+ "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
}
goto out;
}
@@ -980,14 +946,14 @@ server4_rename_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == -1) {
uuid_utoa_r(state->resolve.pargfid, oldpar_str);
uuid_utoa_r(state->resolve2.pargfid, newpar_str);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_RENAME_INFO,
- "%" PRId64
- ": RENAME %s (%s/%s) -> %s (%s/%s), "
- "client: %s, error-xlator: %s",
- frame->root->unique, state->loc.path, oldpar_str,
- state->resolve.bname, state->loc2.path, newpar_str,
- state->resolve2.bname, STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_RENAME_INFO,
+ "frame=%" PRId64, frame->root->unique, "loc.path=%s",
+ state->loc.path, "oldpar_str=%s", oldpar_str, "resolve-name=%s",
+ state->resolve.bname, "loc2.path=%s", state->loc2.path,
+ "newpar_str=%s", newpar_str, "resolve2=%s",
+ state->resolve2.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1022,14 +988,13 @@ server4_unlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_UNLINK, op_errno), op_errno,
- PS_MSG_LINK_INFO,
- "%" PRId64
- ": UNLINK %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_UNLINK, op_errno), op_errno,
+ PS_MSG_LINK_INFO, "frame=%" PRId64, frame->root->unique,
+ "UNLINK_path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1072,13 +1037,13 @@ server4_symlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
- "%" PRId64
- ": SYMLINK %s (%s/%s), client: %s, "
- "error-xlator:%s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
+ "frame=%" PRId64, frame->root->unique, "SYMLINK_path= %s",
+ (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s",
+ uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1123,13 +1088,12 @@ server4_link_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
uuid_utoa_r(state->resolve.gfid, gfid_str);
uuid_utoa_r(state->resolve2.pargfid, newpar_str);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
- "%" PRId64
- ": LINK %s (%s) -> %s/%s, client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path, gfid_str, newpar_str,
- state->resolve2.bname, STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
+ "frame=%" PRId64, frame->root->unique, "LINK_path=%s",
+ state->loc.path, "gfid_str=%s", gfid_str, "newpar_str=%s",
+ newpar_str, "resolve2.bname=%s", state->resolve2.bname,
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1163,13 +1127,11 @@ server4_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_TRUNCATE_INFO,
- "%" PRId64
- ": TRUNCATE %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_TRUNCATE_INFO,
+ "frame=%" PRId64, frame->root->unique, "TRUNCATE_path=%s",
+ state->loc.path, "uuid_utoa=%s", uuid_utoa(state->resolve.gfid),
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1203,14 +1165,12 @@ server4_fstat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_FSTAT, op_errno), op_errno,
- PS_MSG_STAT_INFO,
- "%" PRId64 ": FSTAT %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FSTAT, op_errno), op_errno,
+ PS_MSG_STAT_INFO, "frame=%" PRId64, frame->root->unique,
+ "FSTAT_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1242,14 +1202,12 @@ server4_ftruncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FTRUNCATE, op_errno), op_errno,
- PS_MSG_TRUNCATE_INFO,
- "%" PRId64 ": FTRUNCATE %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FTRUNCATE, op_errno), op_errno,
+ PS_MSG_TRUNCATE_INFO, "frame=%" PRId64, frame->root->unique,
+ "FTRUNCATE_fd_no=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1282,14 +1240,12 @@ server4_flush_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FLUSH, op_errno), op_errno,
- PS_MSG_FLUSH_INFO,
- "%" PRId64 ": FLUSH %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FLUSH, op_errno), op_errno,
+ PS_MSG_FLUSH_INFO, "frame=%" PRId64, frame->root->unique,
+ "FLUSH_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1321,14 +1277,12 @@ server4_fsync_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FSYNC, op_errno), op_errno,
- PS_MSG_SYNC_INFO,
- "%" PRId64 ": FSYNC %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FSYNC, op_errno), op_errno,
+ PS_MSG_SYNC_INFO, "frame=%" PRId64, frame->root->unique,
+ "FSYNC_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1362,14 +1316,12 @@ server4_writev_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_WRITE, op_errno), op_errno,
- PS_MSG_WRITE_INFO,
- "%" PRId64 ": WRITEV %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_WRITE, op_errno), op_errno,
+ PS_MSG_WRITE_INFO, "frame=%" PRId64, frame->root->unique,
+ "WRITEV_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1414,14 +1366,12 @@ server4_readv_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_READ, op_errno), op_errno,
- PS_MSG_READ_INFO,
- "%" PRId64 ": READV %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_READ, op_errno), op_errno,
+ PS_MSG_READ_INFO, "frame=%" PRId64, frame->root->unique,
+ "READV_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1455,14 +1405,12 @@ server4_rchecksum_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_RCHECKSUM, op_errno), op_errno,
- PS_MSG_CHKSUM_INFO,
- "%" PRId64 ": RCHECKSUM %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_RCHECKSUM, op_errno), op_errno,
+ PS_MSG_CHKSUM_INFO, "frame=%" PRId64, frame->root->unique,
+ "RCHECKSUM_fd_no=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1494,12 +1442,12 @@ server4_open_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_OPEN, op_errno), op_errno,
- PS_MSG_OPEN_INFO,
- "%" PRId64 ": OPEN %s (%s), client: %s, error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_OPEN, op_errno), op_errno,
+ PS_MSG_OPEN_INFO, "frame=%" PRId64, frame->root->unique,
+ "OPEN_path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1536,13 +1484,12 @@ server4_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO,
- "%" PRId64
- ": CREATE %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(
+ this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1592,13 +1539,11 @@ server4_readlink_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
- "%" PRId64
- ": READLINK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_LINK_INFO,
+ "frame=%" PRId64, frame->root->unique, "READLINK_path=%s",
+ state->loc.path, "uuid_utoa=%s", uuid_utoa(state->resolve.gfid),
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1633,12 +1578,12 @@ server4_stat_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_STAT, op_errno), op_errno,
- PS_MSG_STAT_INFO,
- "%" PRId64 ": STAT %s (%s), client: %s, error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_STAT, op_errno), op_errno,
+ PS_MSG_STAT_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", (state->loc.path) ? state->loc.path : "",
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1671,13 +1616,12 @@ server4_setattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETATTR_INFO,
- "%" PRId64
- ": SETATTR %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, (state->loc.path) ? state->loc.path : "",
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETATTR_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s",
+ (state->loc.path) ? state->loc.path : "", "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1711,14 +1655,12 @@ server4_fsetattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FSETATTR, op_errno), op_errno,
- PS_MSG_SETATTR_INFO,
- "%" PRId64 ": FSETATTR %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FSETATTR, op_errno), op_errno,
+ PS_MSG_SETATTR_INFO, "frame=%" PRId64,
+ "FSETATTR_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1752,14 +1694,12 @@ server4_xattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_XATTROP, op_errno), op_errno,
- PS_MSG_XATTROP_INFO,
- "%" PRId64
- ": XATTROP %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_XATTROP, op_errno), op_errno,
+ PS_MSG_XATTROP_INFO, "frame=%" PRId64, frame->root->unique,
+ "path=%s", state->loc.path, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1794,14 +1734,12 @@ server4_fxattrop_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FXATTROP, op_errno), op_errno,
- PS_MSG_XATTROP_INFO,
- "%" PRId64 ": FXATTROP %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FXATTROP, op_errno), op_errno,
+ PS_MSG_XATTROP_INFO, "frame=%" PRId64, frame->root->unique,
+ "FXATTROP_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1840,14 +1778,12 @@ server4_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_READDIRP, op_errno), op_errno,
- PS_MSG_DIR_INFO,
- "%" PRId64 ": READDIRP %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_READDIRP, op_errno), op_errno,
+ PS_MSG_DIR_INFO, "frame=%" PRId64, frame->root->unique,
+ "READDIRP_fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1893,14 +1829,12 @@ server4_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_FALLOCATE, op_errno), op_errno,
- PS_MSG_ALLOC_INFO,
- "%" PRId64 ": FALLOCATE %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_FALLOCATE, op_errno), op_errno,
+ PS_MSG_ALLOC_INFO, "frame=%" PRId64, frame->root->unique,
+ "FALLOCATE_fd_no=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1934,14 +1868,12 @@ server4_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret) {
state = CALL_STATE(frame);
- gf_msg(this->name, fop_log_level(GF_FOP_DISCARD, op_errno), op_errno,
- PS_MSG_DISCARD_INFO,
- "%" PRId64 ": DISCARD %" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_DISCARD, op_errno), op_errno,
+ PS_MSG_DISCARD_INFO, "frame=%" PRId64, frame->root->unique,
+ "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator: %s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -1977,14 +1909,12 @@ server4_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
dict_to_xdr(xdata, &rsp.xdata);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_ZEROFILL, op_errno), op_errno,
- PS_MSG_ZEROFILL_INFO,
- "%" PRId64 ": ZEROFILL%" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_ZEROFILL, op_errno), op_errno,
+ PS_MSG_ZEROFILL_INFO, "frame=%" PRId64, frame->root->unique,
+ "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2018,13 +1948,12 @@ server4_ipc_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
dict_to_xdr(xdata, &rsp.xdata);
if (op_ret) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_IPC_INFO,
- "%" PRId64 ": IPC%" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SERVER_IPC_INFO,
+ "frame=%" PRId64, frame->root->unique, "IPC=%" PRId64,
+ state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2056,14 +1985,12 @@ server4_seek_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
dict_to_xdr(xdata, &rsp.xdata);
if (op_ret) {
- gf_msg(this->name, fop_log_level(GF_FOP_SEEK, op_errno), op_errno,
- PS_MSG_SEEK_INFO,
- "%" PRId64 ": SEEK%" PRId64
- " (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_SEEK, op_errno), op_errno,
+ PS_MSG_SEEK_INFO, "frame=%" PRId64, frame->root->unique,
+ "fd_no=%" PRId64, state->resolve.fd_no, "uuid_utoa=%s",
+ uuid_utoa(state->resolve.gfid), "client=%s",
+ STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2096,13 +2023,11 @@ server4_setactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, 0,
- "%" PRId64
- ": SETACTIVELK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_SETACTIVELK_INFO,
+ "frame=%" PRId64, frame->root->unique, "path==%s",
+ state->loc.path, "uuid_utoa=%s", uuid_utoa(state->resolve.gfid),
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2171,9 +2096,10 @@ server4_icreate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO,
- "%" PRId64 ": ICREATE [%s] ==> (%s)", frame->root->unique,
- uuid_utoa(state->resolve.gfid), strerror(op_errno));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_CREATE_INFO,
+ "frame=%" PRId64, uuid_utoa(state->resolve.gfid),
+ "ICREATE_gfid=%s", uuid_utoa(state->resolve.gfid),
+ "op_errno=%s", strerror(op_errno), NULL);
goto out;
}
@@ -2226,13 +2152,12 @@ server4_put_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
state = CALL_STATE(frame);
if (op_ret < 0) {
- gf_msg(this->name, GF_LOG_INFO, op_errno, PS_MSG_PUT_INFO,
- "%" PRId64
- ": PUT %s (%s/%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.pargfid), state->resolve.bname,
- STACK_CLIENT_NAME(frame->root), STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(
+ this->name, GF_LOG_INFO, op_errno, PS_MSG_PUT_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s", state->loc.path,
+ "uuid_utoa=%s", uuid_utoa(state->resolve.pargfid), "bname=%s",
+ state->resolve.bname, "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2280,14 +2205,13 @@ server4_copy_file_range_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
uuid_utoa_r(state->resolve.gfid, in_gfid);
uuid_utoa_r(state->resolve2.gfid, out_gfid);
- gf_msg(this->name, fop_log_level(GF_FOP_COPY_FILE_RANGE, op_errno),
- op_errno, PS_MSG_WRITE_INFO,
- "%" PRId64 ": COPY_FILE_RANGE %" PRId64 " (%s), %" PRId64
- " (%s) client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->resolve.fd_no, in_gfid,
- state->resolve2.fd_no, out_gfid, STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, fop_log_level(GF_FOP_COPY_FILE_RANGE, op_errno),
+ op_errno, PS_MSG_WRITE_INFO, "frame=%" PRId64,
+ frame->root->unique, "COPY_FILE_RANGE_fd_no=%" PRId64,
+ state->resolve.fd_no, "in_gfid=%s", in_gfid,
+ "resolve2_fd_no=%" PRId64, state->resolve2.fd_no, "out_gfid=%s",
+ out_gfid, "client=%s", STACK_CLIENT_NAME(frame->root),
+ "error-xlator=%s", STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -2773,8 +2697,7 @@ server4_opendir_resume(call_frame_t *frame, xlator_t *bound_xl)
state->fd = fd_create(state->loc.inode, frame->root->pid);
if (!state->fd) {
- gf_msg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED,
- "could not create the fd");
+ gf_smsg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED, NULL);
goto err;
}
@@ -3137,9 +3060,9 @@ server4_create_resume(call_frame_t *frame, xlator_t *bound_xl)
state->fd = fd_create(state->loc.inode, frame->root->pid);
if (!state->fd) {
- gf_msg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED,
- "fd creation for the inode %s failed",
- state->loc.inode ? uuid_utoa(state->loc.inode->gfid) : NULL);
+ gf_smsg("server", GF_LOG_ERROR, 0, PS_MSG_FD_CREATE_FAILED, "inode=%s",
+ state->loc.inode ? uuid_utoa(state->loc.inode->gfid) : NULL,
+ NULL);
state->resolve.op_ret = -1;
state->resolve.op_errno = ENOMEM;
goto err;
@@ -3385,13 +3308,11 @@ server4_getactivelk_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret < 0) {
state = CALL_STATE(frame);
- gf_msg(this->name, GF_LOG_INFO, op_errno, 0,
- "%" PRId64
- ": GETACTIVELK %s (%s), client: %s, "
- "error-xlator: %s",
- frame->root->unique, state->loc.path,
- uuid_utoa(state->resolve.gfid), STACK_CLIENT_NAME(frame->root),
- STACK_ERR_XL_NAME(frame->root));
+ gf_smsg(this->name, GF_LOG_INFO, op_errno, PS_MSG_GETACTIVELK_INFO,
+ "frame=%" PRId64, frame->root->unique, "path=%s",
+ state->loc.path, "gfid=%s", uuid_utoa(state->resolve.gfid),
+ "client=%s", STACK_CLIENT_NAME(frame->root), "error-xlator=%s",
+ STACK_ERR_XL_NAME(frame->root), NULL);
goto out;
}
@@ -4112,9 +4033,8 @@ server4_0_release(rpcsvc_request_t *req)
serv_ctx = server_ctx_get(client, client->this);
if (serv_ctx == NULL) {
- gf_msg(req->trans->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
- "server_ctx_get() "
- "failed");
+ gf_smsg(req->trans->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
+ NULL);
req->rpc_err = SYSTEM_ERR;
goto out;
}
@@ -4158,9 +4078,8 @@ server4_0_releasedir(rpcsvc_request_t *req)
serv_ctx = server_ctx_get(client, client->this);
if (serv_ctx == NULL) {
- gf_msg(req->trans->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
- "server_ctx_get() "
- "failed");
+ gf_smsg(req->trans->name, GF_LOG_INFO, 0, PS_MSG_SERVER_CTX_GET_FAILED,
+ NULL);
req->rpc_err = SYSTEM_ERR;
goto out;
}
@@ -5531,13 +5450,10 @@ server4_0_lk(rpcsvc_request_t *req)
state->flock.l_type = F_UNLCK;
break;
default:
- gf_msg(frame->root->client->bound_xl->name, GF_LOG_ERROR, 0,
- PS_MSG_LOCK_ERROR,
- "fd - %" PRId64
- " (%s): Unknown "
- "lock type: %" PRId32 "!",
- state->resolve.fd_no, uuid_utoa(state->fd->inode->gfid),
- state->type);
+ gf_smsg(frame->root->client->bound_xl->name, GF_LOG_ERROR, 0,
+ PS_MSG_LOCK_ERROR, "fd=%" PRId64, state->resolve.fd_no,
+ "uuid_utoa=%s", uuid_utoa(state->fd->inode->gfid),
+ "lock type=" PRId32, state->type, NULL);
break;
}
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 222dc9a18f1..721968004a0 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -108,8 +108,7 @@ server_submit_reply(call_frame_t *frame, rpcsvc_request_t *req, void *arg,
iob = gfs_serialize_reply(req, arg, &rsp, xdrproc);
if (!iob) {
- gf_msg("", GF_LOG_ERROR, 0, PS_MSG_SERIALIZE_REPLY_FAILED,
- "Failed to serialize reply");
+ gf_smsg("", GF_LOG_ERROR, 0, PS_MSG_SERIALIZE_REPLY_FAILED, NULL);
goto ret;
}
@@ -268,6 +267,8 @@ server_priv(xlator_t *this)
gf_proc_dump_build_key(key, "server", "total-bytes-write");
gf_proc_dump_write(key, "%" PRIu64, total_write);
+ rpcsvc_statedump(conf->rpc);
+
ret = 0;
out:
if (ret)
@@ -303,8 +304,7 @@ get_auth_types(dict_t *this, char *key, data_t *value, void *data)
/* TODO: backward compatibility, remove when
newer versions are available */
tmp = "addr";
- gf_msg("server", GF_LOG_WARNING, 0, PS_MSG_AUTH_IP_ERROR,
- "assuming 'auth.ip' to be 'auth.addr'");
+ gf_smsg("server", GF_LOG_WARNING, 0, PS_MSG_AUTH_IP_ERROR, NULL);
}
ret = dict_set_dynptr(auth_dict, tmp, NULL, 0);
if (ret < 0) {
@@ -333,8 +333,8 @@ _check_for_auth_option(dict_t *d, char *k, data_t *v, void *tmp)
goto out;
if (strncmp(tail, "addr.", 5) != 0) {
- gf_msg(xl->name, GF_LOG_TRACE, 0, PS_MSG_SKIP_FORMAT_CHK,
- "skip format check for non-addr auth option %s", k);
+ gf_smsg(xl->name, GF_LOG_TRACE, 0, PS_MSG_SKIP_FORMAT_CHK, "option=%s",
+ k, NULL);
goto out;
}
@@ -356,10 +356,8 @@ _check_for_auth_option(dict_t *d, char *k, data_t *v, void *tmp)
ret = xlator_option_validate_addr_list(xl, "auth-*", v->data, NULL,
NULL);
if (ret)
- gf_msg(xl->name, GF_LOG_ERROR, 0, PS_MSG_INTERNET_ADDR_ERROR,
- "internet address '%s' does not conform "
- "to standards.",
- v->data);
+ gf_smsg(xl->name, GF_LOG_ERROR, 0, PS_MSG_INTERNET_ADDR_ERROR,
+ "data=%s", v->data, NULL);
}
out:
return ret;
@@ -379,11 +377,8 @@ validate_auth_options(xlator_t *this, dict_t *dict)
error = dict_foreach(dict, _check_for_auth_option, trav->xlator);
if (-1 == error) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_AUTHENTICATE_ERROR,
- "volume '%s' "
- "defined as subvolume, but no authentication "
- "defined for the same",
- trav->xlator->name);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_AUTHENTICATE_ERROR,
+ "name=%s", trav->xlator->name, NULL);
break;
}
trav = trav->next;
@@ -410,7 +405,14 @@ server_call_xlator_mem_cleanup(xlator_t *this, char *victim_name)
arg = calloc(1, sizeof(*arg));
arg->this = this;
- arg->victim_name = gf_strdup(victim_name);
+ arg->victim_name = strdup(victim_name);
+ if (!arg->victim_name) {
+ gf_smsg(this->name, GF_LOG_CRITICAL, ENOMEM, LG_MSG_NO_MEMORY,
+ "Memory allocation is failed");
+ free(arg);
+ return;
+ }
+
th_ret = gf_thread_create_detached(&th_id, server_graph_janitor_threads,
arg, "graphjanitor");
if (th_ret) {
@@ -418,7 +420,7 @@ server_call_xlator_mem_cleanup(xlator_t *this, char *victim_name)
"graph janitor Thread"
" creation is failed for brick %s",
victim_name);
- GF_FREE(arg->victim_name);
+ free(arg->victim_name);
free(arg);
}
}
@@ -494,15 +496,13 @@ server_rpc_notify(rpcsvc_t *rpc, void *xl, rpcsvc_event_t event, void *data)
if (!client)
goto unref_transport;
- gf_msg(this->name, GF_LOG_INFO, 0, PS_MSG_CLIENT_DISCONNECTING,
- "disconnecting connection"
- " from %s",
- client->client_uid);
+ gf_smsg(this->name, GF_LOG_INFO, 0, PS_MSG_CLIENT_DISCONNECTING,
+ "client-uid=%s", client->client_uid, NULL);
ret = dict_get_str_sizen(this->options, "auth-path", &auth_path);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PS_MSG_DICT_GET_FAILED,
- "failed to get auth-path");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PS_MSG_DICT_GET_FAILED,
+ "type=auth-path", NULL);
auth_path = NULL;
}
@@ -630,7 +630,7 @@ server_graph_janitor_threads(void *data)
}
out:
- GF_FREE(arg->victim_name);
+ free(arg->victim_name);
free(arg);
return NULL;
}
@@ -645,8 +645,7 @@ server_mem_acct_init(xlator_t *this)
ret = xlator_mem_acct_init(this, gf_server_mt_end + 1);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_ERROR, ENOMEM, PS_MSG_NO_MEMORY,
- "Memory accounting init failed");
+ gf_smsg(this->name, GF_LOG_ERROR, ENOMEM, PS_MSG_NO_MEMORY, NULL);
return ret;
}
out:
@@ -775,9 +774,8 @@ server_reconfigure(xlator_t *this, dict_t *options)
if (data) {
ret = gf_string2boolean(data->data, &trace);
if (ret != 0) {
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
- "'trace' takes on only "
- "boolean values. Neglecting option");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
+ NULL);
ret = -1;
goto out;
}
@@ -787,8 +785,7 @@ server_reconfigure(xlator_t *this, dict_t *options)
GF_OPTION_RECONF("statedump-path", statedump_path, options, path, do_auth);
if (!statedump_path) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_STATEDUMP_PATH_ERROR,
- "Error while reconfiguring statedump path");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_STATEDUMP_PATH_ERROR, NULL);
goto do_auth;
}
gf_path_strip_trailing_slashes(statedump_path);
@@ -821,16 +818,14 @@ do_auth:
GF_OPTION_RECONF("gid-timeout", conf->gid_cache_timeout, options, int32,
do_rpc);
if (gid_cache_reconf(&conf->gid_cache, conf->gid_cache_timeout) < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_GRP_CACHE_ERROR,
- "Failed to reconfigure group cache.");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_GRP_CACHE_ERROR, NULL);
goto do_rpc;
}
do_rpc:
rpc_conf = conf->rpc;
if (!rpc_conf) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONF_ERROR,
- "No rpc_conf !!!!");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONF_ERROR, NULL);
goto out;
}
@@ -884,9 +879,8 @@ do_rpc:
ret = gf_authenticate(xprt->clnt_options, options,
conf->auth_modules);
if (ret == AUTH_ACCEPT) {
- gf_msg(kid->name, GF_LOG_TRACE, 0, PS_MSG_CLIENT_ACCEPTED,
- "authorized client, hence we "
- "continue with this connection");
+ gf_smsg(kid->name, GF_LOG_TRACE, 0, PS_MSG_CLIENT_ACCEPTED,
+ NULL);
} else {
gf_event(EVENT_CLIENT_AUTH_REJECT,
"client_uid=%s;"
@@ -896,11 +890,10 @@ do_rpc:
xprt->xl_private->client_uid,
xprt->peerinfo.identifier, xprt->myinfo.identifier,
auth_path);
- gf_msg(this->name, GF_LOG_INFO, EACCES,
- PS_MSG_AUTHENTICATE_ERROR,
- "unauthorized client, hence "
- "terminating the connection %s",
- xprt->peerinfo.identifier);
+ gf_smsg(this->name, GF_LOG_INFO, EACCES,
+ PS_MSG_UNAUTHORIZED_CLIENT,
+ "peerinfo-identifier=%s", xprt->peerinfo.identifier,
+ NULL);
rpc_transport_disconnect(xprt, _gf_false);
}
}
@@ -911,8 +904,7 @@ do_rpc:
ret = rpcsvc_set_outstanding_rpc_limit(
rpc_conf, options, RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONF_ERROR,
- "Failed to reconfigure outstanding-rpc-limit");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_RECONFIGURE_FAILED, NULL);
goto out;
}
@@ -922,9 +914,8 @@ do_rpc:
if (listeners->trans->reconfigure)
listeners->trans->reconfigure(listeners->trans, options);
else
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_ERROR,
- "Reconfigure "
- "not found for transport");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_ERROR,
+ NULL);
}
}
@@ -1052,14 +1043,12 @@ server_init(xlator_t *this)
GF_VALIDATE_OR_GOTO("init", this, out);
if (this->children == NULL) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_SUBVOL_NULL,
- "protocol/server should have subvolume");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_SUBVOL_NULL, NULL);
goto out;
}
if (this->parents != NULL) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_PARENT_VOL_ERROR,
- "protocol/server should not have parent volumes");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_PARENT_VOL_ERROR, NULL);
goto out;
}
@@ -1096,8 +1085,8 @@ server_init(xlator_t *this)
gf_path_strip_trailing_slashes(statedump_path);
this->ctx->statedump_path = gf_strdup(statedump_path);
} else {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_STATEDUMP_PATH_ERROR,
- "Error setting statedump path");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_SET_STATEDUMP_PATH_ERROR,
+ NULL);
ret = -1;
goto out;
}
@@ -1128,8 +1117,7 @@ server_init(xlator_t *this)
GF_OPTION_INIT("gid-timeout", conf->gid_cache_timeout, int32, out);
if (gid_cache_init(&conf->gid_cache, conf->gid_cache_timeout) < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_GRP_CACHE_ERROR,
- "Failed to initialize group cache.");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_INIT_GRP_CACHE_ERROR, NULL);
goto out;
}
@@ -1148,9 +1136,7 @@ server_init(xlator_t *this)
/* RPC related */
conf->rpc = rpcsvc_init(this, this->ctx, this->options, 0);
if (conf->rpc == NULL) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPCSVC_CREATE_FAILED,
- "creation of rpcsvc "
- "failed");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPCSVC_CREATE_FAILED, NULL);
ret = -1;
goto out;
}
@@ -1158,8 +1144,7 @@ server_init(xlator_t *this)
ret = rpcsvc_set_outstanding_rpc_limit(
conf->rpc, this->options, RPCSVC_DEFAULT_OUTSTANDING_RPC_LIMIT);
if (ret < 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONF_ERROR,
- "Failed to configure outstanding-rpc-limit");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_RPC_CONFIGURE_FAILED, NULL);
goto out;
}
@@ -1171,15 +1156,15 @@ server_init(xlator_t *this)
ret = dict_get_str_sizen(this->options, "transport-type", &transport_type);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_ERROR,
- "option transport-type not set");
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_TYPE_NOT_SET,
+ NULL);
ret = -1;
goto out;
}
total_transport = rpc_transport_count(transport_type);
if (total_transport <= 0) {
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_TRANSPORT_ERROR,
- "failed to get total number of available tranpsorts");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_GET_TOTAL_AVAIL_TRANSPORT_FAILED, NULL);
ret = -1;
goto out;
}
@@ -1188,24 +1173,21 @@ server_init(xlator_t *this)
ret = rpcsvc_create_listeners(conf->rpc, this->options, this->name);
if (ret < 1) {
- gf_msg(this->name, GF_LOG_WARNING, 0,
- PS_MSG_RPCSVC_LISTENER_CREATE_FAILED,
- "creation of listener failed");
+ gf_smsg(this->name, GF_LOG_WARNING, 0,
+ PS_MSG_RPCSVC_LISTENER_CREATE_FAILED, NULL);
if (ret != -EADDRINUSE)
ret = -1;
goto out;
} else if (ret < total_transport) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- PS_MSG_RPCSVC_LISTENER_CREATE_FAILED,
- "creation of %d listeners failed, continuing with "
- "succeeded transport",
- (total_transport - ret));
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_RPCSVC_LISTENER_CREATE_FAILED, "number=%d",
+ "continuing with succeeded transport", (total_transport - ret),
+ NULL);
}
ret = rpcsvc_register_notify(conf->rpc, server_rpc_notify, this);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PS_MSG_RPCSVC_NOTIFY,
- "registration of notify with rpcsvc failed");
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PS_MSG_RPCSVC_NOTIFY, NULL);
goto out;
}
@@ -1215,11 +1197,10 @@ server_init(xlator_t *this)
*/
ret = rpcsvc_program_register(conf->rpc, &glusterfs3_3_fop_prog, _gf_true);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED,
- "registration of program (name:%s, prognum:%d, "
- "progver:%d) failed",
- glusterfs3_3_fop_prog.progname, glusterfs3_3_fop_prog.prognum,
- glusterfs3_3_fop_prog.progver);
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED, "name=%s",
+ glusterfs3_3_fop_prog.progname, "prognum=%d",
+ glusterfs3_3_fop_prog.prognum, "progver=%d",
+ glusterfs3_3_fop_prog.progver, NULL);
goto out;
}
@@ -1239,11 +1220,10 @@ server_init(xlator_t *this)
ret = rpcsvc_program_register(conf->rpc, &gluster_handshake_prog,
_gf_false);
if (ret) {
- gf_msg(this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED,
- "registration of program (name:%s, prognum:%d, "
- "progver:%d) failed",
- gluster_handshake_prog.progname, gluster_handshake_prog.prognum,
- gluster_handshake_prog.progver);
+ gf_smsg(this->name, GF_LOG_WARNING, 0, PS_MSG_PGM_REG_FAILED, "name=%s",
+ gluster_handshake_prog.progname, "prognum=%d",
+ gluster_handshake_prog.prognum, "progver=%d",
+ gluster_handshake_prog.progver, NULL);
rpcsvc_program_unregister(conf->rpc, &glusterfs3_3_fop_prog);
rpcsvc_program_unregister(conf->rpc, &glusterfs4_0_fop_prog);
goto out;
@@ -1257,18 +1237,14 @@ server_init(xlator_t *this)
lim.rlim_max = 1048576;
if (setrlimit(RLIMIT_NOFILE, &lim) == -1) {
- gf_msg(this->name, GF_LOG_WARNING, errno, PS_MSG_ULIMIT_SET_FAILED,
- "WARNING: Failed to "
- "set 'ulimit -n 1M': %s",
- strerror(errno));
+ gf_smsg(this->name, GF_LOG_WARNING, errno, PS_MSG_ULIMIT_SET_FAILED,
+ "errno=%s", strerror(errno), NULL);
lim.rlim_cur = 65536;
lim.rlim_max = 65536;
if (setrlimit(RLIMIT_NOFILE, &lim) == -1) {
- gf_msg(this->name, GF_LOG_WARNING, errno, PS_MSG_FD_NOT_FOUND,
- "Failed to set "
- "max open fd to 64k: %s",
- strerror(errno));
+ gf_smsg(this->name, GF_LOG_WARNING, errno, PS_MSG_FD_NOT_FOUND,
+ "errno=%s", strerror(errno), NULL);
} else {
gf_msg_trace(this->name, 0,
"max open fd set "
@@ -1280,9 +1256,8 @@ server_init(xlator_t *this)
if (!this->ctx->cmd_args.volfile_id) {
/* In some use cases this is a valid case, but
document this to be annoying log in that case */
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_VOL_FILE_OPEN_FAILED,
- "volfile-id argument not given. "
- "This is mandatory argument, defaulting to 'gluster'");
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_VOL_FILE_OPEN_FAILED,
+ NULL);
this->ctx->cmd_args.volfile_id = gf_strdup("gluster");
}
FIRST_CHILD(this)->volfile_id = gf_strdup(this->ctx->cmd_args.volfile_id);
@@ -1418,9 +1393,9 @@ server_process_event_upcall(xlator_t *this, void *data)
xdrproc = (xdrproc_t)xdr_gfs4_entrylk_contention_req;
break;
default:
- gf_msg(this->name, GF_LOG_WARNING, EINVAL, PS_MSG_INVALID_ENTRY,
- "Received invalid upcall event(%d)",
- upcall_data->event_type);
+ gf_smsg(this->name, GF_LOG_WARNING, EINVAL,
+ PS_MSG_INVLAID_UPCALL_EVENT, "event-type=%d",
+ upcall_data->event_type, NULL);
goto out;
}
@@ -1512,10 +1487,8 @@ server_process_child_event(xlator_t *this, int32_t event, void *data,
}
if (!tmp->name)
- gf_msg(this->name, GF_LOG_ERROR, 0, PS_MSG_CHILD_STATUS_FAILED,
- "No xlator %s is found in "
- "child status list",
- victim->name);
+ gf_smsg(this->name, GF_LOG_ERROR, 0, PS_MSG_CHILD_STATUS_FAILED,
+ "name=%s", victim->name, NULL);
}
list_for_each_entry(xprt, &conf->xprt_list, list)
{
@@ -1564,9 +1537,8 @@ server_notify(xlator_t *this, int32_t event, void *data, ...)
ret = server_process_event_upcall(this, data);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED,
- "server_process_event_upcall failed");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_SERVER_EVENT_UPCALL_FAILED, NULL);
goto out;
}
break;
@@ -1585,9 +1557,8 @@ server_notify(xlator_t *this, int32_t event, void *data, ...)
ret = server_process_child_event(this, event, data,
GF_CBK_CHILD_UP);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED,
- "server_process_child_event failed");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_SERVER_CHILD_EVENT_FAILED, NULL);
goto out;
}
default_notify(this, event, data);
@@ -1604,9 +1575,8 @@ server_notify(xlator_t *this, int32_t event, void *data, ...)
ret = server_process_child_event(this, event, data,
GF_CBK_CHILD_DOWN);
if (ret) {
- gf_msg(this->name, GF_LOG_ERROR, 0,
- PS_MSG_SERVER_EVENT_UPCALL_FAILED,
- "server_process_child_event failed");
+ gf_smsg(this->name, GF_LOG_ERROR, 0,
+ PS_MSG_SERVER_CHILD_EVENT_FAILED, NULL);
goto out;
}
default_notify(this, event, data);