summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client-rpc-fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/client/src/client-rpc-fops.c')
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c593
1 files changed, 390 insertions, 203 deletions
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index e8e3cdfbb40..223a60d68be 100644
--- a/xlators/protocol/client/src/client-rpc-fops.c
+++ b/xlators/protocol/client/src/client-rpc-fops.c
@@ -18,6 +18,7 @@
#include "glusterfs3-xdr.h"
#include "glusterfs3.h"
#include "compat-errno.h"
+#include "client-messages.h"
int32_t client3_getspec (call_frame_t *frame, xlator_t *this, void *data);
rpc_clnt_prog_t clnt3_3_fop_prog;
@@ -56,16 +57,18 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame,
if (iobref != NULL) {
ret = iobref_merge (new_iobref, iobref);
if (ret != 0) {
- gf_log (this->name, GF_LOG_WARNING,
- "cannot merge iobref passed from caller "
- "into new_iobref");
+ gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
+ PC_MSG_NO_MEMORY, "cannot merge "
+ "iobref passed from caller into "
+ "new_iobref");
}
}
ret = iobref_add (new_iobref, iobuf);
if (ret != 0) {
- gf_log (this->name, GF_LOG_WARNING,
- "cannot add iobuf into iobref");
+ gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
+ PC_MSG_NO_MEMORY, "cannot add iobuf into "
+ "iobref");
goto unwind;
}
@@ -89,7 +92,7 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame,
payload, payloadcnt, new_iobref, frame, NULL, 0,
NULL, 0, NULL);
if (ret < 0) {
- gf_log (this->name, GF_LOG_DEBUG, "rpc_clnt_submit failed");
+ gf_msg_debug (this->name, 0, "rpc_clnt_submit failed");
}
if (new_iobref)
@@ -144,7 +147,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -167,7 +171,8 @@ out:
/* no need to print the gfid, because it will be null,
* since symlink operation failed.
*/
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s. Path: (%s to %s)",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path, local->loc2.path);
@@ -217,7 +222,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -237,8 +243,9 @@ 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_log (this->name, fop_log_level (GF_FOP_MKNOD,
+ gf_msg (this->name, fop_log_level (GF_FOP_MKNOD,
gf_error_to_errno (rsp.op_errno)),
+ rsp.op_errno, PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s. Path: %s",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path);
@@ -285,7 +292,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -305,8 +313,9 @@ 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_log (this->name, fop_log_level (GF_FOP_MKDIR,
- gf_error_to_errno (rsp.op_errno)),
+ gf_msg (this->name, fop_log_level (GF_FOP_MKDIR,
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s. Path: %s",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path);
@@ -426,7 +435,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -448,8 +458,9 @@ client3_3_open_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, fop_log_level (GF_FOP_OPEN,
- gf_error_to_errno (rsp.op_errno)),
+ gf_msg (this->name, fop_log_level (GF_FOP_OPEN,
+ gf_error_to_errno (rsp.op_errno)),
+ rsp.op_errno, PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s. Path: %s (%s)",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path, loc_gfid_utoa (&local->loc));
@@ -489,7 +500,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -507,10 +519,17 @@ out:
if (rsp.op_ret == -1) {
/* stale filehandles are possible during normal operations, no
* need to spam the logs with these */
- gf_log (this->name,
- rsp.op_errno == ESTALE ? GF_LOG_DEBUG : GF_LOG_WARNING,
- "remote operation failed: %s",
- strerror (gf_error_to_errno (rsp.op_errno)));
+ if (rsp.op_errno == ESTALE) {
+ 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, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
+ strerror (gf_error_to_errno (rsp.op_errno)));
+ }
}
CLIENT_STACK_UNWIND (stat, frame, rsp.op_ret,
@@ -547,7 +566,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -563,9 +583,16 @@ client3_3_readlink_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, (gf_error_to_errno(rsp.op_errno) == ENOENT)?
- GF_LOG_DEBUG:GF_LOG_WARNING, "remote operation failed:"
- " %s", strerror (gf_error_to_errno (rsp.op_errno)));
+ if (gf_error_to_errno(rsp.op_errno) == ENOENT) {
+ 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, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
+ "failed: %s", strerror
+ (gf_error_to_errno (rsp.op_errno)));
+ }
}
CLIENT_STACK_UNWIND (readlink, frame, rsp.op_ret,
@@ -608,7 +635,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -625,11 +653,17 @@ client3_3_unlink_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name,
- ((gf_error_to_errno (rsp.op_errno) == ENOENT)
- ? GF_LOG_DEBUG : GF_LOG_WARNING),
- "remote operation failed: %s",
- strerror (gf_error_to_errno (rsp.op_errno)));
+ if (gf_error_to_errno(rsp.op_errno) == ENOENT) {
+ 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,
+ rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
+ "failed: %s", strerror
+ (gf_error_to_errno (rsp.op_errno)));
+ }
}
CLIENT_STACK_UNWIND (unlink, frame, rsp.op_ret,
@@ -668,7 +702,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -685,7 +720,8 @@ client3_3_rmdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (rmdir, frame, rsp.op_ret,
@@ -725,7 +761,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -742,7 +779,9 @@ client3_3_truncate_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (truncate, frame, rsp.op_ret,
@@ -781,7 +820,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -797,7 +837,9 @@ client3_3_statfs_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (statfs, frame, rsp.op_ret,
@@ -839,7 +881,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -856,7 +899,9 @@ client3_3_writev_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
} else if (rsp.op_ret >= 0) {
if (local->attempt_reopen)
@@ -897,7 +942,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -906,9 +952,9 @@ client3_3_flush_cbk (struct rpc_req *req, struct iovec *iov, int count,
if (rsp.op_ret >= 0 && !fd_is_anonymous (local->fd)) {
/* Delete all saved locks of the owner issuing flush */
ret = delete_granted_locks_owner (local->fd, &local->owner);
- gf_log (this->name, GF_LOG_TRACE,
- "deleting locks of owner (%s) returned %d",
- lkowner_utoa (&local->owner), ret);
+ gf_msg_trace (this->name, 0,
+ "deleting locks of owner (%s) returned %d",
+ lkowner_utoa (&local->owner), ret);
}
GF_PROTOCOL_DICT_UNSERIALIZE (this, xdata, (rsp.xdata.xdata_val),
@@ -917,8 +963,10 @@ client3_3_flush_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, fop_log_level (GF_FOP_FLUSH,
- gf_error_to_errno (rsp.op_errno)),
+ gf_msg (this->name, fop_log_level (GF_FOP_FLUSH,
+ gf_error_to_errno (rsp.op_errno)),
+ rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -958,7 +1006,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -975,7 +1024,9 @@ client3_3_fsync_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (fsync, frame, rsp.op_ret,
@@ -1013,7 +1064,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1026,11 +1078,16 @@ client3_3_setxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
op_errno = gf_error_to_errno (rsp.op_errno);
if (rsp.op_ret == -1) {
- gf_log (this->name, ((op_errno == ENOTSUP) ?
- GF_LOG_DEBUG : GF_LOG_WARNING),
- "remote operation failed: %s",
- strerror (op_errno));
+ if (op_errno == ENOTSUP) {
+ 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: %s", strerror (op_errno));
+ }
}
+
CLIENT_STACK_UNWIND (setxattr, frame, rsp.op_ret, op_errno, xdata);
free (rsp.xdata.xdata_val);
@@ -1068,7 +1125,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -1088,15 +1146,22 @@ client3_3_getxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, (((op_errno == ENOTSUP) ||
- (op_errno == ENODATA) ||
- (op_errno == ESTALE) ||
- (op_errno == ENOENT)) ?
- GF_LOG_DEBUG : GF_LOG_WARNING),
- "remote operation failed: %s. Path: %s (%s). Key: %s",
- strerror (op_errno),
- local->loc.path, loc_gfid_utoa (&local->loc),
- (local->name) ? local->name : "(null)");
+ if ((op_errno == ENOTSUP) || (op_errno == ENODATA) ||
+ (op_errno == ESTALE) || (op_errno == ENOENT)) {
+ gf_msg_debug (this->name, 0,
+ "remote operation failed: %s. Path: %s "
+ "(%s). Key: %s", strerror (op_errno),
+ local->loc.path,
+ 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: %s. Path: %s (%s). Key: %s",
+ strerror (op_errno), local->loc.path,
+ loc_gfid_utoa (&local->loc),
+ (local->name) ? local->name : "(null)");
+ }
}
CLIENT_STACK_UNWIND (getxattr, frame, rsp.op_ret, op_errno, dict, xdata);
@@ -1141,7 +1206,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -1160,13 +1226,16 @@ client3_3_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, (((op_errno == ENOTSUP) ||
- (op_errno == ERANGE) ||
- (op_errno == ENODATA) ||
- (op_errno == ENOENT)) ?
- GF_LOG_DEBUG : GF_LOG_WARNING),
+ if ((op_errno == ENOTSUP) || (op_errno == ERANGE) ||
+ (op_errno == ENODATA) || (op_errno == ENOENT)) {
+ 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: %s", strerror (op_errno));
+ }
}
CLIENT_STACK_UNWIND (fgetxattr, frame, rsp.op_ret, op_errno, dict, xdata);
@@ -1207,7 +1276,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1220,11 +1290,13 @@ client3_3_removexattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
if ((ENODATA == rsp.op_errno) || (ENOATTR == rsp.op_errno))
- loglevel = GF_LOG_DEBUG;
+ loglevel = 0;
else
loglevel = GF_LOG_WARNING;
- gf_log (this->name, loglevel, "remote operation failed: %s",
+ gf_msg (this->name, loglevel, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -1262,7 +1334,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1274,7 +1347,9 @@ client3_3_fremovexattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (fremovexattr, frame, rsp.op_ret,
@@ -1310,7 +1385,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1322,7 +1398,9 @@ client3_3_fsyncdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (fsyncdir, frame, rsp.op_ret,
@@ -1358,7 +1436,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1370,7 +1449,9 @@ client3_3_access_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (access, frame, rsp.op_ret,
@@ -1409,7 +1490,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1426,7 +1508,9 @@ client3_3_ftruncate_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (ftruncate, frame, rsp.op_ret,
@@ -1464,7 +1548,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1480,7 +1565,9 @@ client3_3_fstat_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (fstat, frame, rsp.op_ret,
@@ -1517,7 +1604,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1529,10 +1617,10 @@ client3_3_inodelk_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, fop_log_level (GF_FOP_INODELK,
- gf_error_to_errno (rsp.op_errno)),
- "remote operation failed: %s",
- strerror (gf_error_to_errno (rsp.op_errno)));
+ gf_msg (this->name, fop_log_level (GF_FOP_INODELK,
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
+ "%s", strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (inodelk, frame, rsp.op_ret,
gf_error_to_errno (rsp.op_errno), xdata);
@@ -1568,7 +1656,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1580,10 +1669,10 @@ client3_3_finodelk_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, fop_log_level (GF_FOP_FINODELK,
- gf_error_to_errno (rsp.op_errno)),
- "remote operation failed: %s",
- strerror (gf_error_to_errno (rsp.op_errno)));
+ gf_msg (this->name, fop_log_level (GF_FOP_FINODELK,
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
+ "%s", strerror (gf_error_to_errno (rsp.op_errno)));
} else if (rsp.op_ret == 0) {
if (local->attempt_reopen)
client_attempt_reopen (local->fd, this);
@@ -1621,7 +1710,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1633,10 +1723,10 @@ client3_3_entrylk_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, fop_log_level (GF_FOP_ENTRYLK,
- gf_error_to_errno (rsp.op_errno)),
- "remote operation failed: %s",
- strerror (gf_error_to_errno (rsp.op_errno)));
+ gf_msg (this->name, fop_log_level (GF_FOP_ENTRYLK,
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
+ "%s", strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (entrylk, frame, rsp.op_ret,
@@ -1672,7 +1762,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1685,7 +1776,9 @@ 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_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -1726,7 +1819,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -1746,8 +1840,9 @@ client3_3_xattrop_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
- "remote operation failed: %s. Path: %s (%s)",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
+ "%s. Path: %s (%s)",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path, loc_gfid_utoa (&local->loc));
}
@@ -1796,7 +1891,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
goto out;
}
op_errno = rsp.op_errno;
@@ -1814,7 +1910,8 @@ client3_3_fxattrop_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s",
strerror (gf_error_to_errno (op_errno)));
} else if (rsp.op_ret == 0) {
@@ -1859,7 +1956,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1872,10 +1970,14 @@ client3_3_fsetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
op_errno = gf_error_to_errno (rsp.op_errno);
if (rsp.op_ret == -1) {
- gf_log (this->name, ((op_errno == ENOTSUP) ?
- GF_LOG_DEBUG : GF_LOG_WARNING),
- "remote operation failed: %s",
- strerror (op_errno));
+ if (op_errno == ENOTSUP) {
+ gf_msg_debug (this->name, 0, "remote operation failed:"
+ " %s", strerror (op_errno));
+ } else {
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
+ "failed: %s", strerror (op_errno));
+ }
}
CLIENT_STACK_UNWIND (fsetxattr, frame, rsp.op_ret, op_errno, xdata);
@@ -1912,7 +2014,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1929,7 +2032,9 @@ client3_3_fsetattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (fsetattr, frame, rsp.op_ret,
@@ -1968,7 +2073,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -1985,7 +2091,9 @@ client3_3_fallocate_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (fallocate, frame, rsp.op_ret,
@@ -2023,7 +2131,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2040,7 +2149,9 @@ client3_3_discard_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (discard, frame, rsp.op_ret,
@@ -2078,7 +2189,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2095,7 +2207,8 @@ client3_3_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -2132,7 +2245,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2144,7 +2258,8 @@ client3_3_ipc_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -2185,7 +2300,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2202,7 +2318,9 @@ client3_3_setattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (setattr, frame, rsp.op_ret,
@@ -2248,7 +2366,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2275,7 +2394,8 @@ client3_3_create_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s. Path: %s",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path);
@@ -2317,7 +2437,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2329,7 +2450,9 @@ client3_3_rchecksum_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (rchecksum, frame, rsp.op_ret,
@@ -2377,7 +2500,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2408,7 +2532,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_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -2451,7 +2576,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2469,7 +2595,8 @@ client3_3_readdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s remote_fd = %d",
strerror (gf_error_to_errno (rsp.op_errno)),
local->cmd);
@@ -2517,7 +2644,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2534,7 +2662,8 @@ client3_3_readdirp_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
@@ -2582,7 +2711,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2604,7 +2734,9 @@ client3_3_rename_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
+ "remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
}
CLIENT_STACK_UNWIND (rename, frame, rsp.op_ret,
@@ -2651,7 +2783,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2671,7 +2804,8 @@ 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_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s (%s -> %s)",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path, local->loc2.path);
@@ -2720,7 +2854,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2742,9 +2877,10 @@ client3_3_opendir_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, fop_log_level (GF_FOP_OPENDIR,
- gf_error_to_errno (rsp.op_errno)),
- "remote operation failed: %s. Path: %s (%s)",
+ gf_msg (this->name, fop_log_level (GF_FOP_OPENDIR,
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
+ "%s. Path: %s (%s)",
strerror (gf_error_to_errno (rsp.op_errno)),
local->loc.path, loc_gfid_utoa (&local->loc));
}
@@ -2789,7 +2925,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
op_errno = EINVAL;
goto out;
@@ -2810,8 +2947,8 @@ client3_3_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count,
if ((!gf_uuid_is_null (inode->gfid))
&& (gf_uuid_compare (stbuf.ia_gfid, inode->gfid) != 0)) {
- gf_log (frame->this->name, GF_LOG_DEBUG,
- "gfid changed for %s", local->loc.path);
+ gf_msg_debug (frame->this->name, 0,
+ "gfid changed for %s", local->loc.path);
rsp.op_ret = -1;
op_errno = ESTALE;
@@ -2829,12 +2966,14 @@ out:
/* any error other than ENOENT */
if (!(local->loc.name && rsp.op_errno == ENOENT) &&
!(rsp.op_errno == ESTALE))
- gf_log (this->name, GF_LOG_WARNING,
- "remote operation failed: %s. Path: %s (%s)",
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
+ "failed: %s. Path: %s (%s)",
strerror (rsp.op_errno), local->loc.path,
loc_gfid_utoa (&local->loc));
else
- gf_log (this->name, GF_LOG_TRACE, "not found on remote node");
+ gf_msg_trace (this->name, 0, "not found on remote "
+ "node");
}
@@ -2878,7 +3017,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_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
goto out;
@@ -2903,7 +3043,8 @@ client3_3_readv_cbk (struct rpc_req *req, struct iovec *iov, int count,
out:
if (rsp.op_ret == -1) {
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
+ PC_MSG_REMOTE_OP_FAILED,
"remote operation failed: %s",
strerror (gf_error_to_errno (rsp.op_errno)));
} else if (rsp.op_ret >= 0) {
@@ -2958,7 +3099,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx)
conf = (clnt_conf_t *) this->private;
if (fdctx->remote_fd == -1) {
- gf_log (this->name, GF_LOG_DEBUG, "not a valid fd");
+ gf_msg_debug (this->name, 0, "not a valid fd");
goto out;
}
@@ -2988,7 +3129,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx)
if (fdctx->is_dir) {
gfs3_releasedir_req req = {{0,},};
req.fd = fdctx->remote_fd;
- gf_log (this->name, GF_LOG_TRACE, "sending releasedir on fd");
+ gf_msg_trace (this->name, 0, "sending releasedir on fd");
client_submit_request (this, &req, fr, &clnt3_3_fop_prog,
GFS3_OP_RELEASEDIR,
client3_3_releasedir_cbk,
@@ -2997,7 +3138,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx)
} else {
gfs3_release_req req = {{0,},};
req.fd = fdctx->remote_fd;
- gf_log (this->name, GF_LOG_TRACE, "sending release on fd");
+ gf_msg_trace (this->name, 0, "sending release on fd");
client_submit_request (this, &req, fr, &clnt3_3_fop_prog,
GFS3_OP_RELEASE,
client3_3_release_cbk, NULL,
@@ -3194,7 +3335,8 @@ client3_3_lookup (call_frame_t *frame, xlator_t *this,
(xdrproc_t)xdr_gfs3_lookup_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3251,7 +3393,8 @@ client3_3_stat (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_stat_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3305,7 +3448,8 @@ client3_3_truncate (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_truncate_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3353,7 +3497,8 @@ client3_3_ftruncate (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_ftruncate_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3407,7 +3552,8 @@ client3_3_access (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_access_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3493,7 +3639,8 @@ client3_3_readlink (call_frame_t *frame, xlator_t *this,
local->iobref,
(xdrproc_t)xdr_gfs3_readlink_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3552,7 +3699,8 @@ client3_3_unlink (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_unlink_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3605,7 +3753,8 @@ client3_3_rmdir (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_rmdir_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3671,7 +3820,8 @@ client3_3_symlink (call_frame_t *frame, xlator_t *this,
NULL, NULL, 0, NULL,
0, NULL, (xdrproc_t)xdr_gfs3_symlink_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3736,7 +3886,8 @@ client3_3_rename (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_rename_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3812,7 +3963,8 @@ client3_3_link (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_link_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3879,7 +4031,8 @@ client3_3_mknod (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_mknod_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -3947,7 +4100,8 @@ client3_3_mkdir (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_mkdir_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4017,7 +4171,8 @@ client3_3_create (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_create_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4085,7 +4240,8 @@ client3_3_open (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_open_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4159,7 +4315,7 @@ client3_3_readv (call_frame_t *frame, xlator_t *this,
rsp_iobuf = NULL;
if (args->size > rsp_vec.iov_len) {
- gf_log (this->name, GF_LOG_WARNING,
+ 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);
@@ -4180,7 +4336,8 @@ client3_3_readv (call_frame_t *frame, xlator_t *this,
(xdrproc_t)xdr_gfs3_read_req);
if (ret) {
//unwind is done in the cbk
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4253,7 +4410,8 @@ 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_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4312,7 +4470,8 @@ client3_3_flush (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_flush_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4361,7 +4520,8 @@ client3_3_fsync (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_fsync_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
@@ -4409,7 +4569,8 @@ client3_3_fstat (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_fstat_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4474,7 +4635,8 @@ client3_3_opendir (call_frame_t *frame, xlator_t *this,
NULL, NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_opendir_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4525,7 +4687,8 @@ client3_3_fsyncdir (call_frame_t *frame, xlator_t *this, void *data)
NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_fsyncdir_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4581,7 +4744,8 @@ client3_3_statfs (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_statfs_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4642,7 +4806,8 @@ client3_3_setxattr (call_frame_t *frame, xlator_t *this,
NULL, NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_setxattr_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.dict.dict_val);
@@ -4699,7 +4864,8 @@ client3_3_fsetxattr (call_frame_t *frame, xlator_t *this,
NULL, NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_fsetxattr_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.dict.dict_val);
@@ -4795,7 +4961,8 @@ client3_3_fgetxattr (call_frame_t *frame, xlator_t *this,
NULL, 0, local->iobref,
(xdrproc_t)xdr_gfs3_fgetxattr_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -4908,8 +5075,9 @@ client3_3_getxattr (call_frame_t *frame, xlator_t *this,
args->loc->inode,
dict);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING,
- "Client dump locks failed");
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
+ PC_MSG_INVALID_ENTRY, "Client dump "
+ "locks failed");
op_errno = EINVAL;
}
@@ -4930,7 +5098,8 @@ client3_3_getxattr (call_frame_t *frame, xlator_t *this,
NULL, 0, local->iobref,
(xdrproc_t)xdr_gfs3_getxattr_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5038,7 +5207,8 @@ client3_3_xattrop (call_frame_t *frame, xlator_t *this,
NULL, 0, local->iobref,
(xdrproc_t)xdr_gfs3_xattrop_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.dict.dict_val);
@@ -5141,7 +5311,8 @@ client3_3_fxattrop (call_frame_t *frame, xlator_t *this,
NULL, 0, local->iobref,
(xdrproc_t)xdr_gfs3_fxattrop_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.dict.dict_val);
@@ -5205,7 +5376,8 @@ client3_3_removexattr (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_removexattr_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5255,7 +5427,8 @@ client3_3_fremovexattr (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_fremovexattr_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5300,8 +5473,8 @@ client3_3_lk (call_frame_t *frame, xlator_t *this,
ret = client_cmd_to_gf_cmd (args->cmd, &gf_cmd);
if (ret) {
op_errno = EINVAL;
- gf_log (this->name, GF_LOG_WARNING,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
+ PC_MSG_INVALID_ENTRY, "Unknown cmd (%d)!", gf_cmd);
goto unwind;
}
@@ -5336,7 +5509,8 @@ client3_3_lk (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gfs3_lk_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5384,8 +5558,8 @@ client3_3_inodelk (call_frame_t *frame, xlator_t *this,
else if (args->cmd == F_SETLKW || args->cmd == F_SETLKW64)
gf_cmd = GF_LK_SETLKW;
else {
- gf_log (this->name, GF_LOG_WARNING,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
+ PC_MSG_INVALID_ENTRY, "Unknown cmd (%d)!", gf_cmd);
op_errno = EINVAL;
goto unwind;
}
@@ -5418,7 +5592,8 @@ client3_3_inodelk (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_inodelk_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5466,8 +5641,8 @@ client3_3_finodelk (call_frame_t *frame, xlator_t *this,
else if (args->cmd == F_SETLKW || args->cmd == F_SETLKW64)
gf_cmd = GF_LK_SETLKW;
else {
- gf_log (this->name, GF_LOG_WARNING,
- "Unknown cmd (%d)!", gf_cmd);
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
+ PC_MSG_INVALID_ENTRY, "Unknown cmd (%d)!", gf_cmd);
goto unwind;
}
@@ -5499,7 +5674,8 @@ client3_3_finodelk (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_finodelk_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5558,7 +5734,8 @@ client3_3_entrylk (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_entrylk_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5613,7 +5790,8 @@ client3_3_fentrylk (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_fentrylk_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5661,7 +5839,8 @@ client3_3_rchecksum (call_frame_t *frame, xlator_t *this,
0, NULL,
(xdrproc_t)xdr_gfs3_rchecksum_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5759,7 +5938,8 @@ client3_3_readdir (call_frame_t *frame, xlator_t *this,
(xdrproc_t)xdr_gfs3_readdir_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5864,7 +6044,8 @@ client3_3_readdirp (call_frame_t *frame, xlator_t *this,
0, rsp_iobref,
(xdrproc_t)xdr_gfs3_readdirp_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.dict.dict_val);
@@ -5924,7 +6105,8 @@ client3_3_setattr (call_frame_t *frame, xlator_t *this,
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_setattr_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -5969,7 +6151,8 @@ client3_3_fsetattr (call_frame_t *frame, xlator_t *this, void *data)
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_fsetattr_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -6016,7 +6199,8 @@ client3_3_fallocate(call_frame_t *frame, xlator_t *this, void *data)
NULL, 0, NULL, 0,
NULL, (xdrproc_t)xdr_gfs3_fallocate_req);
if (ret) {
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
}
GF_FREE (req.xdata.xdata_val);
@@ -6061,7 +6245,8 @@ client3_3_discard(call_frame_t *frame, xlator_t *this, void *data)
NULL, NULL, 0, NULL, 0, NULL,
(xdrproc_t) xdr_gfs3_discard_req);
if (ret)
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
GF_FREE (req.xdata.xdata_val);
@@ -6107,7 +6292,8 @@ client3_3_zerofill(call_frame_t *frame, xlator_t *this, void *data)
NULL, NULL, 0, NULL, 0, NULL,
(xdrproc_t) xdr_gfs3_zerofill_req);
if (ret)
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
GF_FREE (req.xdata.xdata_val);
@@ -6146,7 +6332,8 @@ client3_3_ipc (call_frame_t *frame, xlator_t *this, void *data)
NULL, NULL, 0, NULL, 0, NULL,
(xdrproc_t) xdr_gfs3_ipc_req);
if (ret)
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
+ "failed to send the fop");
GF_FREE (req.xdata.xdata_val);