diff options
Diffstat (limited to 'xlators/protocol/client/src/client-rpc-fops.c')
-rw-r--r-- | xlators/protocol/client/src/client-rpc-fops.c | 593 |
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 54699ba94ac..c85dfb43f7c 100644 --- a/xlators/protocol/client/src/client-rpc-fops.c +++ b/xlators/protocol/client/src/client-rpc-fops.c @@ -13,6 +13,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; @@ -51,16 +52,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; } @@ -84,7 +87,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) @@ -139,7 +142,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; @@ -162,7 +166,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); @@ -212,7 +217,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; @@ -232,8 +238,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); @@ -280,7 +287,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; @@ -300,8 +308,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); @@ -421,7 +430,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; @@ -443,8 +453,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)); @@ -484,7 +495,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; @@ -502,10 +514,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, @@ -542,7 +561,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; @@ -558,9 +578,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, @@ -603,7 +630,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; @@ -620,11 +648,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, @@ -663,7 +697,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; @@ -680,7 +715,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, @@ -720,7 +756,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; @@ -737,7 +774,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, @@ -776,7 +815,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; @@ -792,7 +832,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, @@ -834,7 +876,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; @@ -851,7 +894,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) @@ -892,7 +937,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; @@ -901,9 +947,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), @@ -912,8 +958,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))); } @@ -953,7 +1001,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; @@ -970,7 +1019,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, @@ -1008,7 +1059,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; @@ -1021,11 +1073,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); @@ -1063,7 +1120,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; @@ -1083,15 +1141,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); @@ -1136,7 +1201,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; @@ -1155,13 +1221,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); @@ -1202,7 +1271,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; @@ -1215,11 +1285,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))); } @@ -1257,7 +1329,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; @@ -1269,7 +1342,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, @@ -1305,7 +1380,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; @@ -1317,7 +1393,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, @@ -1353,7 +1431,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; @@ -1365,7 +1444,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, @@ -1404,7 +1485,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; @@ -1421,7 +1503,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, @@ -1459,7 +1543,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; @@ -1475,7 +1560,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, @@ -1512,7 +1599,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; @@ -1524,10 +1612,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); @@ -1563,7 +1651,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; @@ -1575,10 +1664,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); @@ -1616,7 +1705,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; @@ -1628,10 +1718,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, @@ -1667,7 +1757,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; @@ -1680,7 +1771,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))); } @@ -1721,7 +1814,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; @@ -1741,8 +1835,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)); } @@ -1791,7 +1886,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; @@ -1809,7 +1905,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) { @@ -1854,7 +1951,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; @@ -1867,10 +1965,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); @@ -1907,7 +2009,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; @@ -1924,7 +2027,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, @@ -1963,7 +2068,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; @@ -1980,7 +2086,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, @@ -2018,7 +2126,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; @@ -2035,7 +2144,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, @@ -2073,7 +2184,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; @@ -2090,7 +2202,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))); } @@ -2127,7 +2240,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; @@ -2139,7 +2253,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))); } @@ -2180,7 +2295,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; @@ -2197,7 +2313,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, @@ -2243,7 +2361,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; @@ -2270,7 +2389,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); @@ -2312,7 +2432,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; @@ -2324,7 +2445,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, @@ -2372,7 +2495,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; @@ -2403,7 +2527,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))); } @@ -2446,7 +2571,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; @@ -2464,7 +2590,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); @@ -2512,7 +2639,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; @@ -2529,7 +2657,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))); } @@ -2577,7 +2706,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; @@ -2599,7 +2729,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, @@ -2646,7 +2778,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; @@ -2666,7 +2799,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); @@ -2715,7 +2849,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; @@ -2737,9 +2872,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)); } @@ -2784,7 +2920,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; @@ -2805,8 +2942,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; @@ -2824,12 +2961,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"); } @@ -2873,7 +3012,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; @@ -2898,7 +3038,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) { @@ -2953,7 +3094,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; } @@ -2983,7 +3124,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, @@ -2992,7 +3133,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, @@ -3189,7 +3330,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); @@ -3246,7 +3388,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); @@ -3300,7 +3443,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); @@ -3348,7 +3492,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); @@ -3402,7 +3547,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); @@ -3488,7 +3634,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); @@ -3547,7 +3694,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); @@ -3600,7 +3748,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); @@ -3666,7 +3815,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); @@ -3731,7 +3881,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); @@ -3807,7 +3958,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); @@ -3874,7 +4026,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); @@ -3942,7 +4095,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); @@ -4012,7 +4166,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); @@ -4080,7 +4235,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); @@ -4154,7 +4310,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); @@ -4175,7 +4331,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); @@ -4248,7 +4405,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); @@ -4307,7 +4465,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); @@ -4356,7 +4515,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"); } @@ -4404,7 +4564,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); @@ -4469,7 +4630,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); @@ -4520,7 +4682,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); @@ -4576,7 +4739,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); @@ -4637,7 +4801,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); @@ -4694,7 +4859,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); @@ -4790,7 +4956,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); @@ -4903,8 +5070,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; } @@ -4925,7 +5093,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); @@ -5033,7 +5202,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); @@ -5136,7 +5306,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); @@ -5200,7 +5371,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); @@ -5250,7 +5422,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); @@ -5295,8 +5468,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; } @@ -5331,7 +5504,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); @@ -5379,8 +5553,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; } @@ -5413,7 +5587,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); @@ -5461,8 +5636,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; } @@ -5494,7 +5669,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); @@ -5553,7 +5729,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); @@ -5608,7 +5785,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); @@ -5656,7 +5834,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); @@ -5754,7 +5933,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); @@ -5859,7 +6039,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); @@ -5919,7 +6100,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); @@ -5964,7 +6146,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); @@ -6011,7 +6194,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); @@ -6056,7 +6240,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); @@ -6102,7 +6287,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); @@ -6141,7 +6327,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); |