summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/client/src')
-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
10 files changed, 795 insertions, 897 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 {