|
|
cb8e9e |
From 37391a05f78b099bc02f84e555cf173409538346 Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Manikandan Selvaganesh <mselvaga@redhat.com>
|
|
|
cb8e9e |
Date: Mon, 6 Apr 2015 16:21:43 +0530
|
|
|
cb8e9e |
Subject: [PATCH 081/101] protocol/client : porting log messages to new framework
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: I9bf2ca08fef969e566a64475d0f7a16d37e66eeb
|
|
|
cb8e9e |
BUG: 1231775
|
|
|
cb8e9e |
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: http://review.gluster.org/10042
|
|
|
cb8e9e |
Tested-by: Gluster Build System <jenkins@build.gluster.com>
|
|
|
cb8e9e |
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
|
|
|
cb8e9e |
Tested-by: Raghavendra G <rgowdapp@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/50886
|
|
|
cb8e9e |
Reviewed-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
|
|
|
cb8e9e |
Tested-by: Raghavendra Gowdappa <rgowdapp@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
xlators/protocol/client/src/Makefile.am | 2 +-
|
|
|
cb8e9e |
xlators/protocol/client/src/client-callback.c | 16 +-
|
|
|
cb8e9e |
xlators/protocol/client/src/client-handshake.c | 330 +++++++------
|
|
|
cb8e9e |
xlators/protocol/client/src/client-helpers.c | 17 +-
|
|
|
cb8e9e |
xlators/protocol/client/src/client-lk.c | 23 +-
|
|
|
cb8e9e |
xlators/protocol/client/src/client-messages.h | 624 ++++++++++++++++++++++++
|
|
|
cb8e9e |
xlators/protocol/client/src/client-rpc-fops.c | 593 +++++++++++++++--------
|
|
|
cb8e9e |
xlators/protocol/client/src/client.c | 243 ++++-----
|
|
|
cb8e9e |
xlators/protocol/client/src/client.h | 3 +-
|
|
|
cb8e9e |
9 files changed, 1346 insertions(+), 505 deletions(-)
|
|
|
cb8e9e |
create mode 100644 xlators/protocol/client/src/client-messages.h
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/Makefile.am b/xlators/protocol/client/src/Makefile.am
|
|
|
cb8e9e |
index cf89d42..fcdf5e3 100644
|
|
|
cb8e9e |
--- a/xlators/protocol/client/src/Makefile.am
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/Makefile.am
|
|
|
cb8e9e |
@@ -11,7 +11,7 @@ client_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
|
|
|
cb8e9e |
client_la_SOURCES = client.c client-helpers.c client-rpc-fops.c \
|
|
|
cb8e9e |
client-handshake.c client-callback.c client-lk.c
|
|
|
cb8e9e |
|
|
|
cb8e9e |
-noinst_HEADERS = client.h client-mem-types.h
|
|
|
cb8e9e |
+noinst_HEADERS = client.h client-mem-types.h client-messages.h
|
|
|
cb8e9e |
|
|
|
cb8e9e |
AM_CPPFLAGS = $(GF_CPPFLAGS) \
|
|
|
cb8e9e |
-I$(top_srcdir)/libglusterfs/src \
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/client-callback.c b/xlators/protocol/client/src/client-callback.c
|
|
|
cb8e9e |
index 78b9cef..d36a64b 100644
|
|
|
cb8e9e |
--- a/xlators/protocol/client/src/client-callback.c
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/client-callback.c
|
|
|
cb8e9e |
@@ -16,11 +16,12 @@
|
|
|
cb8e9e |
#include "client.h"
|
|
|
cb8e9e |
#include "rpc-clnt.h"
|
|
|
cb8e9e |
#include "defaults.h"
|
|
|
cb8e9e |
+#include "client-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
client_cbk_null (struct rpc_clnt *rpc, void *mydata, void *data)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR,
|
|
|
cb8e9e |
"this function should not be called");
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -28,7 +29,7 @@ client_cbk_null (struct rpc_clnt *rpc, void *mydata, void *data)
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
client_cbk_fetchspec (struct rpc_clnt *rpc, void *mydata, void *data)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR,
|
|
|
cb8e9e |
"this function should not be called");
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -36,7 +37,7 @@ client_cbk_fetchspec (struct rpc_clnt *rpc, void *mydata, void *data)
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
client_cbk_ino_flush (struct rpc_clnt *rpc, void *mydata, void *data)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0, PC_MSG_FUNCTION_CALL_ERROR,
|
|
|
cb8e9e |
"this function should not be called");
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -51,7 +52,7 @@ client_cbk_cache_invalidation (struct rpc_clnt *rpc, void *mydata, void *data)
|
|
|
cb8e9e |
struct gf_upcall_cache_invalidation ca_data = {0,};
|
|
|
cb8e9e |
gfs3_cbk_cache_invalidation_req ca_req = {0,};
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_TRACE, "Upcall callback is called");
|
|
|
cb8e9e |
+ gf_msg_trace (THIS->name, 0, "Upcall callback is called");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!rpc || !mydata || !data)
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -61,7 +62,8 @@ client_cbk_cache_invalidation (struct rpc_clnt *rpc, void *mydata, void *data)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_cbk_cache_invalidation_req);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, -ret,
|
|
|
cb8e9e |
+ PC_MSG_CACHE_INVALIDATION_FAIL,
|
|
|
cb8e9e |
"XDR decode of cache_invalidation failed.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -69,8 +71,8 @@ client_cbk_cache_invalidation (struct rpc_clnt *rpc, void *mydata, void *data)
|
|
|
cb8e9e |
upcall_data.data = &ca_data;
|
|
|
cb8e9e |
gf_proto_cache_invalidation_to_upcall (&ca_req, &upcall_data);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_TRACE, "Upcall gfid = %s, ret = %d",
|
|
|
cb8e9e |
- ca_req.gfid, ret);
|
|
|
cb8e9e |
+ gf_msg_trace (THIS->name, 0, "Upcall gfid = %s, ret = %d",
|
|
|
cb8e9e |
+ ca_req.gfid, ret);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
default_notify (THIS, GF_EVENT_UPCALL, &upcall_data);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
|
|
|
cb8e9e |
index b4c4604..457fa25 100644
|
|
|
cb8e9e |
--- a/xlators/protocol/client/src/client-handshake.c
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/client-handshake.c
|
|
|
cb8e9e |
@@ -24,6 +24,7 @@
|
|
|
cb8e9e |
#include "glusterfs3.h"
|
|
|
cb8e9e |
#include "portmap-xdr.h"
|
|
|
cb8e9e |
#include "rpc-common-xdr.h"
|
|
|
cb8e9e |
+#include "client-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
#define CLIENT_REOPEN_MAX_ATTEMPTS 1024
|
|
|
cb8e9e |
extern rpc_clnt_prog_t clnt3_3_fop_prog;
|
|
|
cb8e9e |
@@ -52,15 +53,16 @@ client3_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
frame = myframe;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!frame || !frame->this) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_ERROR, "frame not found with the request, "
|
|
|
cb8e9e |
- "returning EINVAL");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_ERROR, EINVAL, PC_MSG_INVALID_ENTRY,
|
|
|
cb8e9e |
+ "frame not found with the request, returning EINVAL");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
if (-1 == req->rpc_status) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "received RPC status error, returning ENOTCONN");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, ENOTCONN,
|
|
|
cb8e9e |
+ PC_MSG_RPC_STATUS_ERROR, "received RPC status error, "
|
|
|
cb8e9e |
+ "returning ENOTCONN");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = ENOTCONN;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -68,7 +70,8 @@ client3_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_getspec_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED,
|
|
|
cb8e9e |
"XDR decoding failed, returning EINVAL");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
@@ -76,8 +79,9 @@ client3_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == rsp.op_ret) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "failed to get the 'volume file' from server");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_VOL_FILE_NOT_FOUND, "failed to get the 'volume "
|
|
|
cb8e9e |
+ "file' from server");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -113,7 +117,7 @@ int32_t client3_getspec (call_frame_t *frame, xlator_t *this, void *data)
|
|
|
cb8e9e |
(xdrproc_t)xdr_gf_getspec_req);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_SEND_REQ_FAIL,
|
|
|
cb8e9e |
"failed to send the request");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -133,8 +137,9 @@ client_notify_parents_child_up (xlator_t *this)
|
|
|
cb8e9e |
conf = this->private;
|
|
|
cb8e9e |
ret = client_notify_dispatch (this, GF_EVENT_CHILD_UP, NULL);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
- "notify of CHILD_UP failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_CHILD_UP_NOTIFY_FAILED, "notify of CHILD_UP "
|
|
|
cb8e9e |
+ "failed");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -173,17 +178,18 @@ client_set_lk_version_cbk (struct rpc_req *req, struct iovec *iov,
|
|
|
cb8e9e |
GF_VALIDATE_OR_GOTO ("client", fr, out);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (req->rpc_status == -1) {
|
|
|
cb8e9e |
- gf_log (fr->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "received RPC status error");
|
|
|
cb8e9e |
+ gf_msg (fr->this->name, GF_LOG_WARNING, ENOTCONN,
|
|
|
cb8e9e |
+ PC_MSG_RPC_STATUS_ERROR, "received RPC status error");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_set_lk_ver_rsp);
|
|
|
cb8e9e |
if (ret < 0)
|
|
|
cb8e9e |
- gf_log (fr->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "xdr decoding failed");
|
|
|
cb8e9e |
+ gf_msg (fr->this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "xdr decoding failed");
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log (fr->this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (fr->this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_LOCK_VERSION_SERVER,
|
|
|
cb8e9e |
"Server lk version = %d", rsp.lk_ver);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
@@ -226,7 +232,7 @@ client_set_lk_version (xlator_t *this)
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Sending SET_LK_VERSION");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Sending SET_LK_VERSION");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = client_submit_request (this, &req, frame,
|
|
|
cb8e9e |
conf->handshake,
|
|
|
cb8e9e |
@@ -238,7 +244,7 @@ out:
|
|
|
cb8e9e |
GF_FREE (req.uid);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
err:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_SET_LK_VERSION_ERROR,
|
|
|
cb8e9e |
"Failed to send SET_LK_VERSION to server");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
@@ -461,19 +467,21 @@ client_reacquire_lock_cbk (struct rpc_req *req, struct iovec *iov,
|
|
|
cb8e9e |
conf = (clnt_conf_t *) this->private;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (req->rpc_status == -1) {
|
|
|
cb8e9e |
- gf_log ("client", GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg ("client", GF_LOG_WARNING, 0, PC_MSG_CLIENT_REQ_FAIL,
|
|
|
cb8e9e |
"request failed at rpc");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_lk_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "lock request failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_LOCK_REQ_FAIL,
|
|
|
cb8e9e |
+ "lock request failed");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -482,10 +490,10 @@ client_reacquire_lock_cbk (struct rpc_req *req, struct iovec *iov,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
gf_proto_flock_to_flock (&rsp.flock, &lock);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "%s type lock reacquired on file "
|
|
|
cb8e9e |
- "with gfid %s from %"PRIu64 " to %"PRIu64,
|
|
|
cb8e9e |
- get_lk_type (lock.l_type), uuid_utoa (fdctx->gfid),
|
|
|
cb8e9e |
- lock.l_start, lock.l_start + lock.l_len);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "%s type lock reacquired on file "
|
|
|
cb8e9e |
+ "with gfid %s from %"PRIu64 " to %"PRIu64,
|
|
|
cb8e9e |
+ get_lk_type (lock.l_type), uuid_utoa (fdctx->gfid),
|
|
|
cb8e9e |
+ lock.l_start, lock.l_start + lock.l_len);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!clnt_fd_lk_local_error_status (this, local) &&
|
|
|
cb8e9e |
clnt_fd_lk_local_unref (this, local) == 0) {
|
|
|
cb8e9e |
@@ -531,9 +539,9 @@ _client_reacquire_lock (xlator_t *this, clnt_fd_ctx_t *fdctx)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
local = clnt_fd_lk_local_create (fdctx);
|
|
|
cb8e9e |
if (!local) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "clnt_fd_lk_local_create "
|
|
|
cb8e9e |
- "failed, aborting reacquring of locks on %s.",
|
|
|
cb8e9e |
- uuid_utoa (fdctx->gfid));
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_LOCK_ERROR,
|
|
|
cb8e9e |
+ "clnt_fd_lk_local_create failed, aborting reacquring "
|
|
|
cb8e9e |
+ "of locks on %s.", uuid_utoa (fdctx->gfid));
|
|
|
cb8e9e |
clnt_reacquire_lock_error (this, fdctx, conf);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -546,9 +554,9 @@ _client_reacquire_lock (xlator_t *this, clnt_fd_ctx_t *fdctx)
|
|
|
cb8e9e |
/* to avoid frame being blocked if lock cannot be granted. */
|
|
|
cb8e9e |
ret = client_cmd_to_gf_cmd (F_SETLK, &gf_cmd);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "client_cmd_to_gf_cmd failed, "
|
|
|
cb8e9e |
- "aborting reacquiring of locks");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_LOCK_ERROR, "client_cmd_to_gf_cmd "
|
|
|
cb8e9e |
+ "failed, aborting reacquiring of locks");
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -576,8 +584,9 @@ _client_reacquire_lock (xlator_t *this, clnt_fd_ctx_t *fdctx)
|
|
|
cb8e9e |
NULL, NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_lk_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "reacquiring locks failed on file with gfid %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_LOCK_REACQUIRE, "reacquiring locks "
|
|
|
cb8e9e |
+ "failed on file with gfid %s",
|
|
|
cb8e9e |
uuid_utoa (fdctx->gfid));
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -602,8 +611,8 @@ client_reacquire_lock (xlator_t *this, clnt_fd_ctx_t *fdctx)
|
|
|
cb8e9e |
GF_VALIDATE_OR_GOTO (this->name, fdctx, out);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (client_fd_lk_list_empty (fdctx->lk_ctx, _gf_false)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "fd lock list is empty");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "fd lock list is empty");
|
|
|
cb8e9e |
fdctx->reopen_done (fdctx, this);
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
lk_ctx = fdctx->lk_ctx;
|
|
|
cb8e9e |
@@ -665,7 +674,7 @@ client_child_up_reopen_done (clnt_fd_ctx_t *fdctx, xlator_t *this)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
client_reopen_done (fdctx, this);
|
|
|
cb8e9e |
if (fd_count == 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_CHILD_UP_NOTIFY,
|
|
|
cb8e9e |
"last fd open'd/lock-self-heal'd - notifying CHILD-UP");
|
|
|
cb8e9e |
client_set_lk_version (this);
|
|
|
cb8e9e |
client_notify_parents_child_up (this);
|
|
|
cb8e9e |
@@ -692,8 +701,9 @@ client3_3_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
fdctx = local->fdctx;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == req->rpc_status) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "received RPC status error, returning ENOTCONN");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, ENOTCONN,
|
|
|
cb8e9e |
+ PC_MSG_RPC_STATUS_ERROR, "received RPC status error, "
|
|
|
cb8e9e |
+ "returning ENOTCONN");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = ENOTCONN;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -701,20 +711,21 @@ client3_3_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_open_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (rsp.op_ret < 0) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "reopen on %s failed (%s)",
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_DIR_OP_SUCCESS, "reopen on %s failed (%s)",
|
|
|
cb8e9e |
local->loc.path, strerror (rsp.op_errno));
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "reopen on %s succeeded (remote-fd = %"PRId64")",
|
|
|
cb8e9e |
- local->loc.path, rsp.fd);
|
|
|
cb8e9e |
+ gf_msg_debug (frame->this->name, 0,
|
|
|
cb8e9e |
+ "reopen on %s succeeded (remote-fd = %"PRId64")",
|
|
|
cb8e9e |
+ local->loc.path, rsp.fd);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
@@ -741,13 +752,14 @@ client3_3_reopen_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
if (attempt_lock_recovery) {
|
|
|
cb8e9e |
/* Delay decrementing the reopen fd count until all the
|
|
|
cb8e9e |
locks corresponding to this fd are acquired.*/
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "acquiring locks "
|
|
|
cb8e9e |
- "on %s", local->loc.path);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "acquiring locks "
|
|
|
cb8e9e |
+ "on %s", local->loc.path);
|
|
|
cb8e9e |
ret = client_reacquire_lock (frame->this, local->fdctx);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
clnt_reacquire_lock_error (this, local->fdctx, conf);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "acquiring locks "
|
|
|
cb8e9e |
- "failed on %s", local->loc.path);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_LOCK_ERROR, "acquiring locks failed "
|
|
|
cb8e9e |
+ "on %s", local->loc.path);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -781,8 +793,9 @@ client3_3_reopendir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == req->rpc_status) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "received RPC status error, returning ENOTCONN");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, ENOTCONN,
|
|
|
cb8e9e |
+ PC_MSG_RPC_STATUS_ERROR, "received RPC status error, "
|
|
|
cb8e9e |
+ "returning ENOTCONN");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = ENOTCONN;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -790,20 +803,21 @@ client3_3_reopendir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_opendir_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (rsp.op_ret < 0) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "reopendir on %s failed (%s)",
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_DIR_OP_FAILED, "reopendir on %s failed (%s)",
|
|
|
cb8e9e |
local->loc.path, strerror (rsp.op_errno));
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
- "reopendir on %s succeeded (fd = %"PRId64")",
|
|
|
cb8e9e |
- local->loc.path, rsp.fd);
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_DIR_OP_SUCCESS, "reopendir on %s succeeded "
|
|
|
cb8e9e |
+ "(fd = %"PRId64")", local->loc.path, rsp.fd);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == rsp.op_ret) {
|
|
|
cb8e9e |
@@ -858,8 +872,8 @@ protocol_client_reopendir (clnt_fd_ctx_t *fdctx, xlator_t *this)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
memcpy (req.gfid, fdctx->gfid, 16);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "attempting reopen on %s", local->loc.path);
|
|
|
cb8e9e |
+ gf_msg_debug (frame->this->name, 0,
|
|
|
cb8e9e |
+ "attempting reopen on %s", local->loc.path);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
frame->local = local;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -869,7 +883,7 @@ protocol_client_reopendir (clnt_fd_ctx_t *fdctx, xlator_t *this)
|
|
|
cb8e9e |
NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_opendir_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED,
|
|
|
cb8e9e |
"failed to send the re-opendir request");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -920,15 +934,15 @@ protocol_client_reopenfile (clnt_fd_ctx_t *fdctx, xlator_t *this)
|
|
|
cb8e9e |
req.flags = gf_flags_from_flags (fdctx->flags);
|
|
|
cb8e9e |
req.flags = req.flags & (~(O_TRUNC|O_CREAT|O_EXCL));
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "attempting reopen on %s", local->loc.path);
|
|
|
cb8e9e |
+ gf_msg_debug (frame->this->name, 0,
|
|
|
cb8e9e |
+ "attempting reopen on %s", local->loc.path);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = client_submit_request (this, &req, frame, conf->fops,
|
|
|
cb8e9e |
GFS3_OP_OPEN, client3_3_reopen_cbk, NULL,
|
|
|
cb8e9e |
NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_open_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_DIR_OP_FAILED,
|
|
|
cb8e9e |
"failed to send the re-open request");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1037,9 +1051,9 @@ client_post_handshake (call_frame_t *frame, xlator_t *this)
|
|
|
cb8e9e |
/* Delay notifying CHILD_UP to parents
|
|
|
cb8e9e |
until all locks are recovered */
|
|
|
cb8e9e |
if (count > 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
- "%d fds open - Delaying child_up until they are re-opened",
|
|
|
cb8e9e |
- count);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_CHILD_UP_NOTIFY_DELAY, "%d fds open - Delaying "
|
|
|
cb8e9e |
+ "child_up until they are re-opened", count);
|
|
|
cb8e9e |
client_save_number_fds (conf, count);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
list_for_each_entry_safe (fdctx, tmp, &reopen_head, sfd_pos) {
|
|
|
cb8e9e |
@@ -1048,8 +1062,9 @@ client_post_handshake (call_frame_t *frame, xlator_t *this)
|
|
|
cb8e9e |
protocol_client_reopen (fdctx, this);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "No fds to open - notifying all parents child up");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "No fds to open - notifying all parents child "
|
|
|
cb8e9e |
+ "up");
|
|
|
cb8e9e |
client_set_lk_version (this);
|
|
|
cb8e9e |
client_notify_parents_child_up (this);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1079,23 +1094,24 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
|
|
|
cb8e9e |
conf = this->private;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == req->rpc_status) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "received RPC status error");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, ENOTCONN,
|
|
|
cb8e9e |
+ PC_MSG_RPC_STATUS_ERROR, "received RPC status error");
|
|
|
cb8e9e |
op_ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_setvolume_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
op_ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
op_ret = rsp.op_ret;
|
|
|
cb8e9e |
op_errno = gf_error_to_errno (rsp.op_errno);
|
|
|
cb8e9e |
if (-1 == rsp.op_ret) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "failed to set the volume (%s)",
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_VOL_SET_FAIL, "failed to set the volume (%s)",
|
|
|
cb8e9e |
(op_errno)? strerror (op_errno) : "--");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1107,26 +1123,29 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
|
|
|
cb8e9e |
ret = dict_unserialize (rsp.dict.dict_val,
|
|
|
cb8e9e |
rsp.dict.dict_len, &reply);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "failed to unserialize buffer to dict");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_DICT_UNSERIALIZE_FAIL, "failed to "
|
|
|
cb8e9e |
+ "unserialize buffer to dict");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (reply, "ERROR", &remote_error);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "failed to get ERROR string from reply dict");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_DICT_GET_FAILED, "failed to get ERROR "
|
|
|
cb8e9e |
+ "string from reply dict");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (reply, "process-uuid", &process_uuid);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "failed to get 'process-uuid' from reply dict");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_DICT_GET_FAILED, "failed to get "
|
|
|
cb8e9e |
+ "'process-uuid' from reply dict");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (op_ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_SETVOLUME_FAIL,
|
|
|
cb8e9e |
"SETVOLUME on remote-host failed: %s",
|
|
|
cb8e9e |
remote_error ? remote_error : strerror (op_errno));
|
|
|
cb8e9e |
errno = op_errno;
|
|
|
cb8e9e |
@@ -1140,7 +1159,8 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
|
|
|
cb8e9e |
GF_EVENT_VOLFILE_MODIFIED,
|
|
|
cb8e9e |
NULL);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_VOLFILE_NOTIFY_FAILED,
|
|
|
cb8e9e |
"notify of VOLFILE_MODIFIED failed");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1149,20 +1169,21 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
|
|
|
cb8e9e |
ret = dict_get_str (this->options, "remote-subvolume",
|
|
|
cb8e9e |
&remote_subvol);
|
|
|
cb8e9e |
if (ret || !remote_subvol) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"failed to find key 'remote-subvolume' in the options");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_uint32 (reply, "clnt-lk-version", &lk_ver);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_GET_FAILED,
|
|
|
cb8e9e |
"failed to find key 'clnt-lk-version' in the options");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "clnt-lk-version = %d, "
|
|
|
cb8e9e |
- "server-lk-version = %d", client_get_lk_ver (conf), lk_ver);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "clnt-lk-version = %d, "
|
|
|
cb8e9e |
+ "server-lk-version = %d", client_get_lk_ver (conf),
|
|
|
cb8e9e |
+ lk_ver);
|
|
|
cb8e9e |
/* TODO: currently setpeer path is broken */
|
|
|
cb8e9e |
/*
|
|
|
cb8e9e |
if (process_uuid && req->conn &&
|
|
|
cb8e9e |
@@ -1187,7 +1208,7 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
|
|
|
cb8e9e |
|
|
|
cb8e9e |
conf->client_id = glusterfs_leaf_position(this);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_REMOTE_VOL_CONNECTED,
|
|
|
cb8e9e |
"Connected to %s, attached to remote volume '%s'.",
|
|
|
cb8e9e |
conf->rpc->conn.name,
|
|
|
cb8e9e |
remote_subvol);
|
|
|
cb8e9e |
@@ -1199,27 +1220,30 @@ client_setvolume_cbk (struct rpc_req *req, struct iovec *iov, int count, void *m
|
|
|
cb8e9e |
conf->connected = 1;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (lk_ver != client_get_lk_ver (conf)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO, "Server and Client "
|
|
|
cb8e9e |
- "lk-version numbers are not same, reopening the fds");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_LOCK_MISMATCH,
|
|
|
cb8e9e |
+ "Server and Client lk-version numbers are not same, "
|
|
|
cb8e9e |
+ "reopening the fds");
|
|
|
cb8e9e |
client_mark_fd_bad (this);
|
|
|
cb8e9e |
client_post_handshake (frame, frame->this);
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
/*TODO: Traverse the saved fd list, and send
|
|
|
cb8e9e |
release to the server on fd's that were closed
|
|
|
cb8e9e |
during grace period */
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO, "Server and Client "
|
|
|
cb8e9e |
- "lk-version numbers are same, no need to "
|
|
|
cb8e9e |
- "reopen the fds");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_LOCK_MATCH,
|
|
|
cb8e9e |
+ "Server and Client lk-version numbers are same, no "
|
|
|
cb8e9e |
+ "need to reopen the fds");
|
|
|
cb8e9e |
client_notify_parents_child_up (frame->this);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (auth_fail) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO, "sending AUTH_FAILED event");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_AUTH_FAILED,
|
|
|
cb8e9e |
+ "sending AUTH_FAILED event");
|
|
|
cb8e9e |
ret = client_notify_dispatch (this, GF_EVENT_AUTH_FAILED, NULL);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
- "notify of AUTH_FAILED failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_AUTH_FAILED_NOTIFY_FAILED, "notify of "
|
|
|
cb8e9e |
+ "AUTH_FAILED failed");
|
|
|
cb8e9e |
conf->connecting = 0;
|
|
|
cb8e9e |
conf->connected = 0;
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
@@ -1229,11 +1253,14 @@ out:
|
|
|
cb8e9e |
* background, for now, don't hang here,
|
|
|
cb8e9e |
* tell the parents that i am all ok..
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO, "sending CHILD_CONNECTING event");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_CHILD_CONNECTING_EVENT, "sending "
|
|
|
cb8e9e |
+ "CHILD_CONNECTING event");
|
|
|
cb8e9e |
ret = client_notify_dispatch (this, GF_EVENT_CHILD_CONNECTING,
|
|
|
cb8e9e |
NULL);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_CHILD_CONNECTING_NOTIFY_FAILED,
|
|
|
cb8e9e |
"notify of CHILD_CONNECTING failed");
|
|
|
cb8e9e |
conf->connecting= 1;
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
@@ -1267,8 +1294,9 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc)
|
|
|
cb8e9e |
ret = dict_set_int32 (options, "fops-version",
|
|
|
cb8e9e |
conf->fops->prognum);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "failed to set version-fops(%d) in handshake msg",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_DICT_SET_FAILED, "failed to set "
|
|
|
cb8e9e |
+ "version-fops(%d) in handshake msg",
|
|
|
cb8e9e |
conf->fops->prognum);
|
|
|
cb8e9e |
goto fail;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1277,8 +1305,9 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc)
|
|
|
cb8e9e |
if (conf->mgmt) {
|
|
|
cb8e9e |
ret = dict_set_int32 (options, "mgmt-version", conf->mgmt->prognum);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "failed to set version-mgmt(%d) in handshake msg",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_DICT_SET_FAILED, "failed to set "
|
|
|
cb8e9e |
+ "version-mgmt(%d) in handshake msg",
|
|
|
cb8e9e |
conf->mgmt->prognum);
|
|
|
cb8e9e |
goto fail;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1303,14 +1332,15 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc)
|
|
|
cb8e9e |
this->ctx->process_uuid, this->name,
|
|
|
cb8e9e |
this->graph->id, counter_str);
|
|
|
cb8e9e |
if (-1 == ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "asprintf failed while setting process_uuid");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_PROCESS_UUID_SET_FAIL, "asprintf failed while "
|
|
|
cb8e9e |
+ "setting process_uuid");
|
|
|
cb8e9e |
goto fail;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr (options, "process-uuid", process_uuid_xl);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"failed to set process-uuid(%s) in handshake msg",
|
|
|
cb8e9e |
process_uuid_xl);
|
|
|
cb8e9e |
goto fail;
|
|
|
cb8e9e |
@@ -1318,7 +1348,7 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_str (options, "client-version", PACKAGE_VERSION);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"failed to set client-version(%s) in handshake msg",
|
|
|
cb8e9e |
PACKAGE_VERSION);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1328,27 +1358,29 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc)
|
|
|
cb8e9e |
ret = dict_set_str (options, "volfile-key",
|
|
|
cb8e9e |
this->ctx->cmd_args.volfile_id);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "failed to set 'volfile-key'");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_DICT_SET_FAILED, "failed to "
|
|
|
cb8e9e |
+ "set 'volfile-key'");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = dict_set_uint32 (options, "volfile-checksum",
|
|
|
cb8e9e |
this->graph->volfile_checksum);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "failed to set 'volfile-checksum'");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_DICT_SET_FAILED, "failed to set "
|
|
|
cb8e9e |
+ "'volfile-checksum'");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_int16 (options, "clnt-lk-version",
|
|
|
cb8e9e |
client_get_lk_ver (conf));
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "failed to set clnt-lk-version(%"PRIu32") in handshake msg",
|
|
|
cb8e9e |
- client_get_lk_ver (conf));
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
+ "failed to set clnt-lk-version(%"PRIu32") in handshake "
|
|
|
cb8e9e |
+ "msg", client_get_lk_ver (conf));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_serialized_length (options);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_ERROR,
|
|
|
cb8e9e |
"failed to get serialized length of dict");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto fail;
|
|
|
cb8e9e |
@@ -1358,8 +1390,9 @@ client_setvolume (xlator_t *this, struct rpc_clnt *rpc)
|
|
|
cb8e9e |
gf_client_mt_clnt_req_buf_t);
|
|
|
cb8e9e |
ret = dict_serialize (options, req.dict.dict_val);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "failed to serialize dictionary");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_DICT_SERIALIZE_FAIL, "failed to serialize "
|
|
|
cb8e9e |
+ "dictionary");
|
|
|
cb8e9e |
goto fail;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1386,7 +1419,7 @@ select_server_supported_programs (xlator_t *this, gf_prog_detail *prog)
|
|
|
cb8e9e |
int ret = -1;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!this || !prog) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0, PC_MSG_PGM_NOT_FOUND,
|
|
|
cb8e9e |
"xlator not found OR RPC program not found");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1399,16 +1432,16 @@ select_server_supported_programs (xlator_t *this, gf_prog_detail *prog)
|
|
|
cb8e9e |
if ((clnt3_3_fop_prog.prognum == trav->prognum) &&
|
|
|
cb8e9e |
(clnt3_3_fop_prog.progver == trav->progver)) {
|
|
|
cb8e9e |
conf->fops = &clnt3_3_fop_prog;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
- "Using Program %s, Num (%"PRId64"), "
|
|
|
cb8e9e |
- "Version (%"PRId64")",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_VERSION_INFO, "Using Program %s, "
|
|
|
cb8e9e |
+ "Num (%"PRId64"), Version (%"PRId64")",
|
|
|
cb8e9e |
trav->progname, trav->prognum, trav->progver);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
- "%s (%"PRId64") not supported", trav->progname,
|
|
|
cb8e9e |
- trav->progver);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
+ "%s (%"PRId64") not supported",
|
|
|
cb8e9e |
+ trav->progname, trav->progver);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
trav = trav->next;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1425,7 +1458,7 @@ server_has_portmap (xlator_t *this, gf_prog_detail *prog)
|
|
|
cb8e9e |
int ret = -1;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!this || !prog) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0, PC_MSG_PGM_NOT_FOUND,
|
|
|
cb8e9e |
"xlator not found OR RPC program not found");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1435,8 +1468,8 @@ server_has_portmap (xlator_t *this, gf_prog_detail *prog)
|
|
|
cb8e9e |
while (trav) {
|
|
|
cb8e9e |
if ((trav->prognum == GLUSTER_PMAP_PROGRAM) &&
|
|
|
cb8e9e |
(trav->progver == GLUSTER_PMAP_VERSION)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "detected portmapper on server");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "detected portmapper on server");
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1460,32 +1493,43 @@ client_query_portmap_cbk (struct rpc_req *req, struct iovec *iov, int count, voi
|
|
|
cb8e9e |
|
|
|
cb8e9e |
frame = myframe;
|
|
|
cb8e9e |
if (!frame || !frame->this || !frame->this->private) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "frame not found with rpc request");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY, "frame not found with rpc "
|
|
|
cb8e9e |
+ "request");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
this = frame->this;
|
|
|
cb8e9e |
conf = frame->this->private;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == req->rpc_status) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "received RPC status error, try again later");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, ENOTCONN,
|
|
|
cb8e9e |
+ PC_MSG_RPC_STATUS_ERROR, "received RPC status error, "
|
|
|
cb8e9e |
+ "try again later");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_pmap_port_by_brick_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == rsp.op_ret) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log (this->name, ((!conf->portmap_err_logged) ?
|
|
|
cb8e9e |
- GF_LOG_ERROR : GF_LOG_DEBUG),
|
|
|
cb8e9e |
- "failed to get the port number for remote subvolume. "
|
|
|
cb8e9e |
- "Please run 'gluster volume status' on server to see "
|
|
|
cb8e9e |
- "if brick process is running.");
|
|
|
cb8e9e |
+ if (!conf->portmap_err_logged) {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_PORT_NUM_ERROR, "failed to get the "
|
|
|
cb8e9e |
+ "port number for remote subvolume. Please run "
|
|
|
cb8e9e |
+ "'gluster volume status' on server to see if "
|
|
|
cb8e9e |
+ "brick process is running.");
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "failed to get the port number for "
|
|
|
cb8e9e |
+ "remote subvolume. Please run 'gluster "
|
|
|
cb8e9e |
+ "volume status' on server to see "
|
|
|
cb8e9e |
+ "if brick process is running.");
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
conf->portmap_err_logged = 1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1529,7 +1573,7 @@ client_query_portmap (xlator_t *this, struct rpc_clnt *rpc)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (options, "remote-subvolume", &remote_subvol);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_VOL_SET_FAIL,
|
|
|
cb8e9e |
"remote-subvolume not set in volfile");
|
|
|
cb8e9e |
goto fail;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1576,19 +1620,21 @@ client_dump_version_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
conf = frame->this->private;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (-1 == req->rpc_status) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "received RPC status error");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, ENOTCONN,
|
|
|
cb8e9e |
+ PC_MSG_RPC_STATUS_ERROR, "received RPC status error");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_dump_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
if (-1 == rsp.op_ret) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "failed to get the 'versions' from server");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_VERSION_ERROR, "failed to get the 'versions' "
|
|
|
cb8e9e |
+ "from server");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1601,8 +1647,9 @@ client_dump_version_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
/* Reply in "Name:Program-Number:Program-Version,..." format */
|
|
|
cb8e9e |
ret = select_server_supported_programs (frame->this, rsp.prog);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "server doesn't support the version");
|
|
|
cb8e9e |
+ gf_msg (frame->this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_VERSION_ERROR, "server doesn't support the "
|
|
|
cb8e9e |
+ "version");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1638,7 +1685,8 @@ client_handshake (xlator_t *this, struct rpc_clnt *rpc)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
conf = this->private;
|
|
|
cb8e9e |
if (!conf->handshake) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "handshake program not found");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_PGM_NOT_FOUND,
|
|
|
cb8e9e |
+ "handshake program not found");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c
|
|
|
cb8e9e |
index be5e7b5..62fbc6c 100644
|
|
|
cb8e9e |
--- a/xlators/protocol/client/src/client-helpers.c
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/client-helpers.c
|
|
|
cb8e9e |
@@ -15,6 +15,7 @@
|
|
|
cb8e9e |
|
|
|
cb8e9e |
#include "client.h"
|
|
|
cb8e9e |
#include "fd.h"
|
|
|
cb8e9e |
+#include "client-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
client_fd_lk_list_empty (fd_lk_ctx_t *lk_ctx, gf_boolean_t try_lock)
|
|
|
cb8e9e |
@@ -94,22 +95,26 @@ this_fd_set_ctx (fd_t *file, xlator_t *this, loc_t *loc, clnt_fd_ctx_t *ctx)
|
|
|
cb8e9e |
ret = fd_ctx_get (file, this, &oldaddr);
|
|
|
cb8e9e |
if (ret >= 0) {
|
|
|
cb8e9e |
if (loc)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_FD_DUPLICATE_TRY,
|
|
|
cb8e9e |
"%s (%s): trying duplicate remote fd set. ",
|
|
|
cb8e9e |
loc->path, uuid_utoa (loc->inode->gfid));
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_FD_DUPLICATE_TRY,
|
|
|
cb8e9e |
"%p: trying duplicate remote fd set. ", file);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = fd_ctx_set (file, this, (uint64_t)(unsigned long)ctx);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
if (loc)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_FD_SET_FAIL,
|
|
|
cb8e9e |
"%s (%s): failed to set remote fd",
|
|
|
cb8e9e |
loc->path, uuid_utoa (loc->inode->gfid));
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_FD_SET_FAIL,
|
|
|
cb8e9e |
"%p: failed to set remote fd", file);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -225,9 +230,9 @@ unserialize_rsp_direntp (xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
ret = dict_unserialize (buf, trav->dict.dict_len,
|
|
|
cb8e9e |
&entry->dict);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_DICT_UNSERIALIZE_FAIL,
|
|
|
cb8e9e |
"failed to unserialize xattr dict");
|
|
|
cb8e9e |
- errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
entry->dict->extra_free = buf;
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/client-lk.c b/xlators/protocol/client/src/client-lk.c
|
|
|
cb8e9e |
index b3c36a4..0cf2be3 100644
|
|
|
cb8e9e |
--- a/xlators/protocol/client/src/client-lk.c
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/client-lk.c
|
|
|
cb8e9e |
@@ -12,6 +12,7 @@
|
|
|
cb8e9e |
#include "xlator.h"
|
|
|
cb8e9e |
#include "client.h"
|
|
|
cb8e9e |
#include "lkowner.h"
|
|
|
cb8e9e |
+#include "client-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
static void
|
|
|
cb8e9e |
__insert_and_merge (clnt_fd_ctx_t *fdctx, client_posix_lock_t *lock);
|
|
|
cb8e9e |
@@ -23,7 +24,7 @@ __dump_client_lock (client_posix_lock_t *lock)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
this = THIS;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_CLIENT_LOCK_INFO,
|
|
|
cb8e9e |
"{fd=%p}"
|
|
|
cb8e9e |
"{%s lk-owner:%s %"PRId64" - %"PRId64"}"
|
|
|
cb8e9e |
"{start=%"PRId64" end=%"PRId64"}",
|
|
|
cb8e9e |
@@ -225,7 +226,8 @@ subtract_locks (client_posix_lock_t *big, client_posix_lock_t *small)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
else {
|
|
|
cb8e9e |
/* LOG-TODO : decide what more info is required here*/
|
|
|
cb8e9e |
- gf_log ("client-protocol", GF_LOG_CRITICAL,
|
|
|
cb8e9e |
+ gf_msg ("client-protocol", GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ PC_MSG_LOCK_ERROR,
|
|
|
cb8e9e |
"Unexpected case in subtract_locks. Please send "
|
|
|
cb8e9e |
"a bug report to gluster-devel@gluster.org");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -363,8 +365,8 @@ delete_granted_locks_owner (fd_t *fd, gf_lkowner_t *owner)
|
|
|
cb8e9e |
this = THIS;
|
|
|
cb8e9e |
fdctx = this_fd_get_ctx (fd, this);
|
|
|
cb8e9e |
if (!fdctx) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "fdctx not valid");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_FD_CTX_INVALID, "fdctx not valid");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -387,8 +389,8 @@ delete_granted_locks_owner (fd_t *fd, gf_lkowner_t *owner)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* FIXME: Need to actually print the locks instead of count */
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
- "Number of locks cleared=%d", count);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
+ "Number of locks cleared=%d", count);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
@@ -421,8 +423,8 @@ delete_granted_locks_fd (clnt_fd_ctx_t *fdctx)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* FIXME: Need to actually print the locks instead of count */
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
- "Number of locks cleared=%d", count);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
+ "Number of locks cleared=%d", count);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -516,7 +518,7 @@ client_add_lock_for_recovery (fd_t *fd, struct gf_flock *flock,
|
|
|
cb8e9e |
pthread_mutex_unlock (&conf->lock);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!fdctx) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FD_GET_FAIL,
|
|
|
cb8e9e |
"failed to get fd context. sending EBADFD");
|
|
|
cb8e9e |
ret = -EBADFD;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -551,7 +553,8 @@ client_dump_locks (char *name, inode_t *inode,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr(new_dict, CLIENT_DUMP_LOCKS, dict_string);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"could not set dict with %s", CLIENT_DUMP_LOCKS);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/client-messages.h b/xlators/protocol/client/src/client-messages.h
|
|
|
cb8e9e |
new file mode 100644
|
|
|
cb8e9e |
index 0000000..9239176
|
|
|
cb8e9e |
--- /dev/null
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/client-messages.h
|
|
|
cb8e9e |
@@ -0,0 +1,624 @@
|
|
|
cb8e9e |
+/*
|
|
|
cb8e9e |
+ Copyright (c) 2015 Red Hat, Inc. <http://www.redhat.com>
|
|
|
cb8e9e |
+ This file is part of GlusterFS.
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ This file is licensed to you under your choice of the GNU Lesser
|
|
|
cb8e9e |
+ General Public License, version 3 or any later version (LGPLv3 or
|
|
|
cb8e9e |
+ later), or the GNU General Public License, version 2 (GPLv2), in all
|
|
|
cb8e9e |
+ cases as published by the Free Software Foundation.
|
|
|
cb8e9e |
+*/
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#ifndef _PC_MESSAGES_H__
|
|
|
cb8e9e |
+#define _PC_MESSAGES_H_
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#ifndef _CONFIG_H
|
|
|
cb8e9e |
+#define _CONFIG_H
|
|
|
cb8e9e |
+#include "config.h"
|
|
|
cb8e9e |
+#endif
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#include "glfs-message-id.h"
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*! \file client-messages.h
|
|
|
cb8e9e |
+ * \brief Protocol client log-message IDs and their descriptions
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/* NOTE: Rules for message additions
|
|
|
cb8e9e |
+ * 1) Each instance of a message is _better_ left with a unique message ID, even
|
|
|
cb8e9e |
+ * if the message format is the same. Reasoning is that, if the message
|
|
|
cb8e9e |
+ * format needs to change in one instance, the other instances are not
|
|
|
cb8e9e |
+ * impacted or the new change does not change the ID of the instance being
|
|
|
cb8e9e |
+ * modified.
|
|
|
cb8e9e |
+ * 2) Addition of a message,
|
|
|
cb8e9e |
+ * - Should increment the GLFS_NUM_MESSAGES
|
|
|
cb8e9e |
+ * - Append to the list of messages defined, towards the end
|
|
|
cb8e9e |
+ * - Retain macro naming as glfs_msg_X (for readability across developers)
|
|
|
cb8e9e |
+ * NOTE: Rules for message format modifications
|
|
|
cb8e9e |
+ * 3) Check acorss the code if the message ID macro in question is reused
|
|
|
cb8e9e |
+ * anywhere. If reused then then the modifications should ensure correctness
|
|
|
cb8e9e |
+ * everywhere, or needs a new message ID as (1) above was not adhered to. If
|
|
|
cb8e9e |
+ * not used anywhere, proceed with the required modification.
|
|
|
cb8e9e |
+ * NOTE: Rules for message deletion
|
|
|
cb8e9e |
+ * 4) Check (3) and if used anywhere else, then cannot be deleted. If not used
|
|
|
cb8e9e |
+ * anywhere, then can be deleted, but will leave a hole by design, as
|
|
|
cb8e9e |
+ * addition rules specify modification to the end of the list and not filling
|
|
|
cb8e9e |
+ * holes.
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define GLFS_PC_BASE GLFS_MSGID_COMP_PC
|
|
|
cb8e9e |
+#define GLFS_PC_NUM_MESSAGES 63
|
|
|
cb8e9e |
+#define GLFS_PC_MSGID_END (GLFS_PC_BASE + GLFS_NUM_MESSAGES + 1)
|
|
|
cb8e9e |
+/* Messages with message IDs */
|
|
|
cb8e9e |
+#define glfs_msg_start_x GLFS_PC_BASE, "Invalid: Start of messages"
|
|
|
cb8e9e |
+/*------------*/
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_TIMER_EXPIRED (GLFS_PC_BASE + 1)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_DIR_OP_FAILED (GLFS_PC_BASE + 2)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_FILE_OP_FAILED (GLFS_PC_BASE + 3)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_TIMER_REG (GLFS_PC_BASE + 4)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_GRACE_TIMER_CANCELLED (GLFS_PC_BASE + 5)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_DICT_SET_FAILED (GLFS_PC_BASE + 6)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_DICT_GET_FAILED (GLFS_PC_BASE + 7)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_NO_MEMORY (GLFS_PC_BASE + 8)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_RPC_CBK_FAILED (GLFS_PC_BASE + 9)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_FUNCTION_CALL_ERROR (GLFS_PC_BASE + 10)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_RPC_INITED_ALREADY (GLFS_PC_BASE + 11)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_RPC_INIT (GLFS_PC_BASE + 12)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_RPC_DESTROY (GLFS_PC_BASE + 13)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_RPC_INVALID_CALL (GLFS_PC_BASE + 14)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_INVALID_ENTRY (GLFS_PC_BASE + 15)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_HANDSHAKE_RETURN (GLFS_PC_BASE + 16)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CHILD_UP_NOTIFY_FAILED (GLFS_PC_BASE + 17)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CLIENT_DISCONNECTED (GLFS_PC_BASE + 18)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CHILD_DOWN_NOTIFY_FAILED (GLFS_PC_BASE + 19)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_PARENT_UP (GLFS_PC_BASE + 20)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_PARENT_DOWN (GLFS_PC_BASE + 21)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_RPC_INIT_FAILED (GLFS_PC_BASE + 22)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_RPC_NOTIFY_FAILED (GLFS_PC_BASE + 23)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_FD_DUPLICATE_TRY (GLFS_PC_BASE + 24)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_FD_SET_FAIL (GLFS_PC_BASE + 25)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_DICT_UNSERIALIZE_FAIL (GLFS_PC_BASE + 26)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_FD_GET_FAIL (GLFS_PC_BASE + 27)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_FD_CTX_INVALID (GLFS_PC_BASE + 28)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_FOP_SEND_FAILED (GLFS_PC_BASE + 29)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_XDR_DECODING_FAILED (GLFS_PC_BASE + 30)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_REMOTE_OP_FAILED (GLFS_PC_BASE + 31)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_RPC_STATUS_ERROR (GLFS_PC_BASE + 32)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_VOL_FILE_NOT_FOUND (GLFS_PC_BASE + 33)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_SEND_REQ_FAIL (GLFS_PC_BASE + 34)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_LOCK_VERSION_SERVER (GLFS_PC_BASE + 35)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_SET_LK_VERSION_ERROR (GLFS_PC_BASE + 36)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_LOCK_REQ_FAIL (GLFS_PC_BASE + 37)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CLIENT_REQ_FAIL (GLFS_PC_BASE + 38)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_LOCK_ERROR (GLFS_PC_BASE + 39)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_LOCK_REACQUIRE (GLFS_PC_BASE + 40)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CHILD_UP_NOTIFY (GLFS_PC_BASE + 41)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CHILD_UP_NOTIFY_DELAY (GLFS_PC_BASE + 42)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_VOL_SET_FAIL (GLFS_PC_BASE + 43)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_SETVOLUME_FAIL (GLFS_PC_BASE + 44)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_VOLFILE_NOTIFY_FAILED (GLFS_PC_BASE + 45)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_REMOTE_VOL_CONNECTED (GLFS_PC_BASE + 46)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_LOCK_MISMATCH (GLFS_PC_BASE + 47)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_LOCK_MATCH (GLFS_PC_BASE + 48)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_AUTH_FAILED (GLFS_PC_BASE + 49)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_AUTH_FAILED_NOTIFY_FAILED (GLFS_PC_BASE + 50)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CHILD_CONNECTING_EVENT (GLFS_PC_BASE + 51)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CHILD_CONNECTING_NOTIFY_FAILED (GLFS_PC_BASE + 52)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_PROCESS_UUID_SET_FAIL (GLFS_PC_BASE + 53)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_DICT_ERROR (GLFS_PC_BASE + 54)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_DICT_SERIALIZE_FAIL (GLFS_PC_BASE + 55)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_PGM_NOT_FOUND (GLFS_PC_BASE + 56)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_VERSION_INFO (GLFS_PC_BASE + 57)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_PORT_NUM_ERROR (GLFS_PC_BASE + 58)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_VERSION_ERROR (GLFS_PC_BASE + 59)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_DIR_OP_SUCCESS (GLFS_PC_BASE + 60)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_BAD_FD (GLFS_PC_BASE + 61)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CLIENT_LOCK_INFO (GLFS_PC_BASE + 62)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#define PC_MSG_CACHE_INVALIDATION_FAIL (GLFS_PC_BASE + 63)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*!
|
|
|
cb8e9e |
+ * @messageid
|
|
|
cb8e9e |
+ * @diagnosis
|
|
|
cb8e9e |
+ * @recommendedaction
|
|
|
cb8e9e |
+ *
|
|
|
cb8e9e |
+ */
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+/*------------*/
|
|
|
cb8e9e |
+#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+#endif /* !_PC_MESSAGES_H_ */
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
|
|
|
cb8e9e |
index e8e3cdf..223a60d 100644
|
|
|
cb8e9e |
--- a/xlators/protocol/client/src/client-rpc-fops.c
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/client-rpc-fops.c
|
|
|
cb8e9e |
@@ -18,6 +18,7 @@
|
|
|
cb8e9e |
#include "glusterfs3-xdr.h"
|
|
|
cb8e9e |
#include "glusterfs3.h"
|
|
|
cb8e9e |
#include "compat-errno.h"
|
|
|
cb8e9e |
+#include "client-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int32_t client3_getspec (call_frame_t *frame, xlator_t *this, void *data);
|
|
|
cb8e9e |
rpc_clnt_prog_t clnt3_3_fop_prog;
|
|
|
cb8e9e |
@@ -56,16 +57,18 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame,
|
|
|
cb8e9e |
if (iobref != NULL) {
|
|
|
cb8e9e |
ret = iobref_merge (new_iobref, iobref);
|
|
|
cb8e9e |
if (ret != 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "cannot merge iobref passed from caller "
|
|
|
cb8e9e |
- "into new_iobref");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
|
|
|
cb8e9e |
+ PC_MSG_NO_MEMORY, "cannot merge "
|
|
|
cb8e9e |
+ "iobref passed from caller into "
|
|
|
cb8e9e |
+ "new_iobref");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = iobref_add (new_iobref, iobuf);
|
|
|
cb8e9e |
if (ret != 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "cannot add iobuf into iobref");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
|
|
|
cb8e9e |
+ PC_MSG_NO_MEMORY, "cannot add iobuf into "
|
|
|
cb8e9e |
+ "iobref");
|
|
|
cb8e9e |
goto unwind;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -89,7 +92,7 @@ client_submit_vec_request (xlator_t *this, void *req, call_frame_t *frame,
|
|
|
cb8e9e |
payload, payloadcnt, new_iobref, frame, NULL, 0,
|
|
|
cb8e9e |
NULL, 0, NULL);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "rpc_clnt_submit failed");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "rpc_clnt_submit failed");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (new_iobref)
|
|
|
cb8e9e |
@@ -144,7 +147,8 @@ client3_3_symlink_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_symlink_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -167,7 +171,8 @@ out:
|
|
|
cb8e9e |
/* no need to print the gfid, because it will be null,
|
|
|
cb8e9e |
* since symlink operation failed.
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s. Path: (%s to %s)",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->loc.path, local->loc2.path);
|
|
|
cb8e9e |
@@ -217,7 +222,8 @@ client3_3_mknod_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_mknod_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -237,8 +243,9 @@ client3_3_mknod_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1 &&
|
|
|
cb8e9e |
GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, rsp.op_errno)) {
|
|
|
cb8e9e |
- gf_log (this->name, fop_log_level (GF_FOP_MKNOD,
|
|
|
cb8e9e |
+ gf_msg (this->name, fop_log_level (GF_FOP_MKNOD,
|
|
|
cb8e9e |
gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
+ rsp.op_errno, PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s. Path: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->loc.path);
|
|
|
cb8e9e |
@@ -285,7 +292,8 @@ client3_3_mkdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_mkdir_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -305,8 +313,9 @@ client3_3_mkdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1 &&
|
|
|
cb8e9e |
GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, rsp.op_errno)) {
|
|
|
cb8e9e |
- gf_log (this->name, fop_log_level (GF_FOP_MKDIR,
|
|
|
cb8e9e |
- gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
+ gf_msg (this->name, fop_log_level (GF_FOP_MKDIR,
|
|
|
cb8e9e |
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s. Path: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->loc.path);
|
|
|
cb8e9e |
@@ -426,7 +435,8 @@ client3_3_open_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_open_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -448,8 +458,9 @@ client3_3_open_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, fop_log_level (GF_FOP_OPEN,
|
|
|
cb8e9e |
- gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
+ gf_msg (this->name, fop_log_level (GF_FOP_OPEN,
|
|
|
cb8e9e |
+ gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
+ rsp.op_errno, PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s. Path: %s (%s)",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->loc.path, loc_gfid_utoa (&local->loc));
|
|
|
cb8e9e |
@@ -489,7 +500,8 @@ client3_3_stat_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_stat_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -507,10 +519,17 @@ out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
/* stale filehandles are possible during normal operations, no
|
|
|
cb8e9e |
* need to spam the logs with these */
|
|
|
cb8e9e |
- gf_log (this->name,
|
|
|
cb8e9e |
- rsp.op_errno == ESTALE ? GF_LOG_DEBUG : GF_LOG_WARNING,
|
|
|
cb8e9e |
- "remote operation failed: %s",
|
|
|
cb8e9e |
- strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ if (rsp.op_errno == ESTALE) {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
+ strerror (gf_error_to_errno
|
|
|
cb8e9e |
+ (rsp.op_errno)));
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
+ strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (stat, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -547,7 +566,8 @@ client3_3_readlink_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_readlink_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -563,9 +583,16 @@ client3_3_readlink_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, (gf_error_to_errno(rsp.op_errno) == ENOENT)?
|
|
|
cb8e9e |
- GF_LOG_DEBUG:GF_LOG_WARNING, "remote operation failed:"
|
|
|
cb8e9e |
- " %s", strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ if (gf_error_to_errno(rsp.op_errno) == ENOENT) {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "remote operation failed:"
|
|
|
cb8e9e |
+ " %s", strerror
|
|
|
cb8e9e |
+ (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
|
|
|
cb8e9e |
+ "failed: %s", strerror
|
|
|
cb8e9e |
+ (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (readlink, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -608,7 +635,8 @@ client3_3_unlink_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_unlink_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -625,11 +653,17 @@ client3_3_unlink_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name,
|
|
|
cb8e9e |
- ((gf_error_to_errno (rsp.op_errno) == ENOENT)
|
|
|
cb8e9e |
- ? GF_LOG_DEBUG : GF_LOG_WARNING),
|
|
|
cb8e9e |
- "remote operation failed: %s",
|
|
|
cb8e9e |
- strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ if (gf_error_to_errno(rsp.op_errno) == ENOENT) {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "remote operation failed:"
|
|
|
cb8e9e |
+ " %s", strerror
|
|
|
cb8e9e |
+ (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
|
|
|
cb8e9e |
+ "failed: %s", strerror
|
|
|
cb8e9e |
+ (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (unlink, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -668,7 +702,8 @@ client3_3_rmdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_rmdir_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -685,7 +720,8 @@ client3_3_rmdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (rmdir, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -725,7 +761,8 @@ client3_3_truncate_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_truncate_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -742,7 +779,9 @@ client3_3_truncate_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (truncate, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -781,7 +820,8 @@ client3_3_statfs_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_statfs_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -797,7 +837,9 @@ client3_3_statfs_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (statfs, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -839,7 +881,8 @@ client3_3_writev_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_write_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -856,7 +899,9 @@ client3_3_writev_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
} else if (rsp.op_ret >= 0) {
|
|
|
cb8e9e |
if (local->attempt_reopen)
|
|
|
cb8e9e |
@@ -897,7 +942,8 @@ client3_3_flush_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -906,9 +952,9 @@ client3_3_flush_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
if (rsp.op_ret >= 0 && !fd_is_anonymous (local->fd)) {
|
|
|
cb8e9e |
/* Delete all saved locks of the owner issuing flush */
|
|
|
cb8e9e |
ret = delete_granted_locks_owner (local->fd, &local->owner);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
- "deleting locks of owner (%s) returned %d",
|
|
|
cb8e9e |
- lkowner_utoa (&local->owner), ret);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
+ "deleting locks of owner (%s) returned %d",
|
|
|
cb8e9e |
+ lkowner_utoa (&local->owner), ret);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_PROTOCOL_DICT_UNSERIALIZE (this, xdata, (rsp.xdata.xdata_val),
|
|
|
cb8e9e |
@@ -917,8 +963,10 @@ client3_3_flush_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, fop_log_level (GF_FOP_FLUSH,
|
|
|
cb8e9e |
- gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
+ gf_msg (this->name, fop_log_level (GF_FOP_FLUSH,
|
|
|
cb8e9e |
+ gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
+ rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -958,7 +1006,8 @@ client3_3_fsync_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fsync_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -975,7 +1024,9 @@ client3_3_fsync_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (fsync, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -1013,7 +1064,8 @@ client3_3_setxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1026,11 +1078,16 @@ client3_3_setxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
op_errno = gf_error_to_errno (rsp.op_errno);
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, ((op_errno == ENOTSUP) ?
|
|
|
cb8e9e |
- GF_LOG_DEBUG : GF_LOG_WARNING),
|
|
|
cb8e9e |
- "remote operation failed: %s",
|
|
|
cb8e9e |
- strerror (op_errno));
|
|
|
cb8e9e |
+ if (op_errno == ENOTSUP) {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "remote operation failed:"
|
|
|
cb8e9e |
+ " %s", strerror (op_errno));
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
|
|
|
cb8e9e |
+ "failed: %s", strerror (op_errno));
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (setxattr, frame, rsp.op_ret, op_errno, xdata);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
free (rsp.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -1068,7 +1125,8 @@ client3_3_getxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_getxattr_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1088,15 +1146,22 @@ client3_3_getxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, (((op_errno == ENOTSUP) ||
|
|
|
cb8e9e |
- (op_errno == ENODATA) ||
|
|
|
cb8e9e |
- (op_errno == ESTALE) ||
|
|
|
cb8e9e |
- (op_errno == ENOENT)) ?
|
|
|
cb8e9e |
- GF_LOG_DEBUG : GF_LOG_WARNING),
|
|
|
cb8e9e |
- "remote operation failed: %s. Path: %s (%s). Key: %s",
|
|
|
cb8e9e |
- strerror (op_errno),
|
|
|
cb8e9e |
- local->loc.path, loc_gfid_utoa (&local->loc),
|
|
|
cb8e9e |
- (local->name) ? local->name : "(null)");
|
|
|
cb8e9e |
+ if ((op_errno == ENOTSUP) || (op_errno == ENODATA) ||
|
|
|
cb8e9e |
+ (op_errno == ESTALE) || (op_errno == ENOENT)) {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "remote operation failed: %s. Path: %s "
|
|
|
cb8e9e |
+ "(%s). Key: %s", strerror (op_errno),
|
|
|
cb8e9e |
+ local->loc.path,
|
|
|
cb8e9e |
+ loc_gfid_utoa (&local->loc),
|
|
|
cb8e9e |
+ (local->name) ? local->name : "(null)");
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
|
|
|
cb8e9e |
+ "failed: %s. Path: %s (%s). Key: %s",
|
|
|
cb8e9e |
+ strerror (op_errno), local->loc.path,
|
|
|
cb8e9e |
+ loc_gfid_utoa (&local->loc),
|
|
|
cb8e9e |
+ (local->name) ? local->name : "(null)");
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (getxattr, frame, rsp.op_ret, op_errno, dict, xdata);
|
|
|
cb8e9e |
@@ -1141,7 +1206,8 @@ client3_3_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fgetxattr_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1160,13 +1226,16 @@ client3_3_fgetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, (((op_errno == ENOTSUP) ||
|
|
|
cb8e9e |
- (op_errno == ERANGE) ||
|
|
|
cb8e9e |
- (op_errno == ENODATA) ||
|
|
|
cb8e9e |
- (op_errno == ENOENT)) ?
|
|
|
cb8e9e |
- GF_LOG_DEBUG : GF_LOG_WARNING),
|
|
|
cb8e9e |
+ if ((op_errno == ENOTSUP) || (op_errno == ERANGE) ||
|
|
|
cb8e9e |
+ (op_errno == ENODATA) || (op_errno == ENOENT)) {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
"remote operation failed: %s",
|
|
|
cb8e9e |
strerror (op_errno));
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
|
|
|
cb8e9e |
+ "failed: %s", strerror (op_errno));
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (fgetxattr, frame, rsp.op_ret, op_errno, dict, xdata);
|
|
|
cb8e9e |
@@ -1207,7 +1276,8 @@ client3_3_removexattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1220,11 +1290,13 @@ client3_3_removexattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
if ((ENODATA == rsp.op_errno) || (ENOATTR == rsp.op_errno))
|
|
|
cb8e9e |
- loglevel = GF_LOG_DEBUG;
|
|
|
cb8e9e |
+ loglevel = 0;
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
loglevel = GF_LOG_WARNING;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, loglevel, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, loglevel, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1262,7 +1334,8 @@ client3_3_fremovexattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1274,7 +1347,9 @@ client3_3_fremovexattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (fremovexattr, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -1310,7 +1385,8 @@ client3_3_fsyncdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1322,7 +1398,9 @@ client3_3_fsyncdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (fsyncdir, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -1358,7 +1436,8 @@ client3_3_access_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1370,7 +1449,9 @@ client3_3_access_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (access, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -1409,7 +1490,8 @@ client3_3_ftruncate_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_ftruncate_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1426,7 +1508,9 @@ client3_3_ftruncate_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (ftruncate, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -1464,7 +1548,8 @@ client3_3_fstat_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fstat_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1480,7 +1565,9 @@ client3_3_fstat_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (fstat, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -1517,7 +1604,8 @@ client3_3_inodelk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1529,10 +1617,10 @@ client3_3_inodelk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, fop_log_level (GF_FOP_INODELK,
|
|
|
cb8e9e |
- gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
- "remote operation failed: %s",
|
|
|
cb8e9e |
- strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ gf_msg (this->name, fop_log_level (GF_FOP_INODELK,
|
|
|
cb8e9e |
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
|
|
|
cb8e9e |
+ "%s", strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (inodelk, frame, rsp.op_ret,
|
|
|
cb8e9e |
gf_error_to_errno (rsp.op_errno), xdata);
|
|
|
cb8e9e |
@@ -1568,7 +1656,8 @@ client3_3_finodelk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1580,10 +1669,10 @@ client3_3_finodelk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, fop_log_level (GF_FOP_FINODELK,
|
|
|
cb8e9e |
- gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
- "remote operation failed: %s",
|
|
|
cb8e9e |
- strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ gf_msg (this->name, fop_log_level (GF_FOP_FINODELK,
|
|
|
cb8e9e |
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
|
|
|
cb8e9e |
+ "%s", strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
} else if (rsp.op_ret == 0) {
|
|
|
cb8e9e |
if (local->attempt_reopen)
|
|
|
cb8e9e |
client_attempt_reopen (local->fd, this);
|
|
|
cb8e9e |
@@ -1621,7 +1710,8 @@ client3_3_entrylk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1633,10 +1723,10 @@ client3_3_entrylk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, fop_log_level (GF_FOP_ENTRYLK,
|
|
|
cb8e9e |
- gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
- "remote operation failed: %s",
|
|
|
cb8e9e |
- strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
+ gf_msg (this->name, fop_log_level (GF_FOP_ENTRYLK,
|
|
|
cb8e9e |
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
|
|
|
cb8e9e |
+ "%s", strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (entrylk, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -1672,7 +1762,8 @@ client3_3_fentrylk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1685,7 +1776,9 @@ client3_3_fentrylk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if ((rsp.op_ret == -1) &&
|
|
|
cb8e9e |
(EAGAIN != gf_error_to_errno (rsp.op_errno))) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1726,7 +1819,8 @@ client3_3_xattrop_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_xattrop_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1746,8 +1840,9 @@ client3_3_xattrop_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "remote operation failed: %s. Path: %s (%s)",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
|
|
|
cb8e9e |
+ "%s. Path: %s (%s)",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->loc.path, loc_gfid_utoa (&local->loc));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1796,7 +1891,8 @@ client3_3_fxattrop_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
op_errno = EINVAL;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
op_errno = rsp.op_errno;
|
|
|
cb8e9e |
@@ -1814,7 +1910,8 @@ client3_3_fxattrop_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (op_errno)));
|
|
|
cb8e9e |
} else if (rsp.op_ret == 0) {
|
|
|
cb8e9e |
@@ -1859,7 +1956,8 @@ client3_3_fsetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gf_common_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1872,10 +1970,14 @@ client3_3_fsetxattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
op_errno = gf_error_to_errno (rsp.op_errno);
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, ((op_errno == ENOTSUP) ?
|
|
|
cb8e9e |
- GF_LOG_DEBUG : GF_LOG_WARNING),
|
|
|
cb8e9e |
- "remote operation failed: %s",
|
|
|
cb8e9e |
- strerror (op_errno));
|
|
|
cb8e9e |
+ if (op_errno == ENOTSUP) {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "remote operation failed:"
|
|
|
cb8e9e |
+ " %s", strerror (op_errno));
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
|
|
|
cb8e9e |
+ "failed: %s", strerror (op_errno));
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (fsetxattr, frame, rsp.op_ret, op_errno, xdata);
|
|
|
cb8e9e |
@@ -1912,7 +2014,8 @@ client3_3_fsetattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fsetattr_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1929,7 +2032,9 @@ client3_3_fsetattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (fsetattr, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -1968,7 +2073,8 @@ client3_3_fallocate_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_fallocate_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -1985,7 +2091,9 @@ client3_3_fallocate_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (fallocate, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -2023,7 +2131,8 @@ client3_3_discard_cbk(struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t) xdr_gfs3_discard_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2040,7 +2149,9 @@ client3_3_discard_cbk(struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (discard, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -2078,7 +2189,8 @@ client3_3_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t) xdr_gfs3_zerofill_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2095,7 +2207,8 @@ client3_3_zerofill_cbk(struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2132,7 +2245,8 @@ client3_3_ipc_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
ret = xdr_to_generic(*iov, &rsp, (xdrproc_t) xdr_gfs3_ipc_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2144,7 +2258,8 @@ client3_3_ipc_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2185,7 +2300,8 @@ client3_3_setattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_setattr_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2202,7 +2318,9 @@ client3_3_setattr_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (setattr, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -2248,7 +2366,8 @@ client3_3_create_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_create_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2275,7 +2394,8 @@ client3_3_create_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s. Path: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->loc.path);
|
|
|
cb8e9e |
@@ -2317,7 +2437,8 @@ client3_3_rchecksum_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_rchecksum_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2329,7 +2450,9 @@ client3_3_rchecksum_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (rchecksum, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -2377,7 +2500,8 @@ client3_3_lk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_lk_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2408,7 +2532,8 @@ client3_3_lk_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if ((rsp.op_ret == -1) &&
|
|
|
cb8e9e |
(EAGAIN != gf_error_to_errno (rsp.op_errno))) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2451,7 +2576,8 @@ client3_3_readdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_readdir_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2469,7 +2595,8 @@ client3_3_readdir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s remote_fd = %d",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->cmd);
|
|
|
cb8e9e |
@@ -2517,7 +2644,8 @@ client3_3_readdirp_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_readdirp_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2534,7 +2662,8 @@ client3_3_readdirp_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2582,7 +2711,8 @@ client3_3_rename_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_rename_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2604,7 +2734,9 @@ client3_3_rename_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "remote operation failed: %s",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
+ "remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
CLIENT_STACK_UNWIND (rename, frame, rsp.op_ret,
|
|
|
cb8e9e |
@@ -2651,7 +2783,8 @@ client3_3_link_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_link_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2671,7 +2804,8 @@ client3_3_link_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
if (GF_IGNORE_IF_GSYNCD_SAFE_ERROR(frame, rsp.op_errno)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s (%s -> %s)",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->loc.path, local->loc2.path);
|
|
|
cb8e9e |
@@ -2720,7 +2854,8 @@ client3_3_opendir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_opendir_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2742,9 +2877,10 @@ client3_3_opendir_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, fop_log_level (GF_FOP_OPENDIR,
|
|
|
cb8e9e |
- gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
- "remote operation failed: %s. Path: %s (%s)",
|
|
|
cb8e9e |
+ gf_msg (this->name, fop_log_level (GF_FOP_OPENDIR,
|
|
|
cb8e9e |
+ gf_error_to_errno (rsp.op_errno)), rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation failed: "
|
|
|
cb8e9e |
+ "%s. Path: %s (%s)",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)),
|
|
|
cb8e9e |
local->loc.path, loc_gfid_utoa (&local->loc));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2789,7 +2925,8 @@ client3_3_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_lookup_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2810,8 +2947,8 @@ client3_3_lookup_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if ((!gf_uuid_is_null (inode->gfid))
|
|
|
cb8e9e |
&& (gf_uuid_compare (stbuf.ia_gfid, inode->gfid) != 0)) {
|
|
|
cb8e9e |
- gf_log (frame->this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "gfid changed for %s", local->loc.path);
|
|
|
cb8e9e |
+ gf_msg_debug (frame->this->name, 0,
|
|
|
cb8e9e |
+ "gfid changed for %s", local->loc.path);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
op_errno = ESTALE;
|
|
|
cb8e9e |
@@ -2829,12 +2966,14 @@ out:
|
|
|
cb8e9e |
/* any error other than ENOENT */
|
|
|
cb8e9e |
if (!(local->loc.name && rsp.op_errno == ENOENT) &&
|
|
|
cb8e9e |
!(rsp.op_errno == ESTALE))
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "remote operation failed: %s. Path: %s (%s)",
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED, "remote operation "
|
|
|
cb8e9e |
+ "failed: %s. Path: %s (%s)",
|
|
|
cb8e9e |
strerror (rsp.op_errno), local->loc.path,
|
|
|
cb8e9e |
loc_gfid_utoa (&local->loc));
|
|
|
cb8e9e |
else
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "not found on remote node");
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "not found on remote "
|
|
|
cb8e9e |
+ "node");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2878,7 +3017,8 @@ client3_3_readv_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gfs3_read_rsp);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "XDR decoding failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_XDR_DECODING_FAILED, "XDR decoding failed");
|
|
|
cb8e9e |
rsp.op_ret = -1;
|
|
|
cb8e9e |
rsp.op_errno = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -2903,7 +3043,8 @@ client3_3_readv_cbk (struct rpc_req *req, struct iovec *iov, int count,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (rsp.op_ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, rsp.op_errno,
|
|
|
cb8e9e |
+ PC_MSG_REMOTE_OP_FAILED,
|
|
|
cb8e9e |
"remote operation failed: %s",
|
|
|
cb8e9e |
strerror (gf_error_to_errno (rsp.op_errno)));
|
|
|
cb8e9e |
} else if (rsp.op_ret >= 0) {
|
|
|
cb8e9e |
@@ -2958,7 +3099,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx)
|
|
|
cb8e9e |
conf = (clnt_conf_t *) this->private;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (fdctx->remote_fd == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "not a valid fd");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "not a valid fd");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2988,7 +3129,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx)
|
|
|
cb8e9e |
if (fdctx->is_dir) {
|
|
|
cb8e9e |
gfs3_releasedir_req req = {{0,},};
|
|
|
cb8e9e |
req.fd = fdctx->remote_fd;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "sending releasedir on fd");
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "sending releasedir on fd");
|
|
|
cb8e9e |
client_submit_request (this, &req, fr, &clnt3_3_fop_prog,
|
|
|
cb8e9e |
GFS3_OP_RELEASEDIR,
|
|
|
cb8e9e |
client3_3_releasedir_cbk,
|
|
|
cb8e9e |
@@ -2997,7 +3138,7 @@ client_fdctx_destroy (xlator_t *this, clnt_fd_ctx_t *fdctx)
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
gfs3_release_req req = {{0,},};
|
|
|
cb8e9e |
req.fd = fdctx->remote_fd;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "sending release on fd");
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "sending release on fd");
|
|
|
cb8e9e |
client_submit_request (this, &req, fr, &clnt3_3_fop_prog,
|
|
|
cb8e9e |
GFS3_OP_RELEASE,
|
|
|
cb8e9e |
client3_3_release_cbk, NULL,
|
|
|
cb8e9e |
@@ -3194,7 +3335,8 @@ client3_3_lookup (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_lookup_req);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3251,7 +3393,8 @@ client3_3_stat (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_stat_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3305,7 +3448,8 @@ client3_3_truncate (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_truncate_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3353,7 +3497,8 @@ client3_3_ftruncate (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_ftruncate_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3407,7 +3552,8 @@ client3_3_access (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_access_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3493,7 +3639,8 @@ client3_3_readlink (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
local->iobref,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_readlink_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3552,7 +3699,8 @@ client3_3_unlink (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_unlink_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3605,7 +3753,8 @@ client3_3_rmdir (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_rmdir_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3671,7 +3820,8 @@ client3_3_symlink (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, NULL, 0, NULL,
|
|
|
cb8e9e |
0, NULL, (xdrproc_t)xdr_gfs3_symlink_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3736,7 +3886,8 @@ client3_3_rename (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_rename_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3812,7 +3963,8 @@ client3_3_link (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_link_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -3879,7 +4031,8 @@ client3_3_mknod (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_mknod_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -3947,7 +4100,8 @@ client3_3_mkdir (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_mkdir_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4017,7 +4171,8 @@ client3_3_create (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_create_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4085,7 +4240,8 @@ client3_3_open (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_open_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4159,7 +4315,7 @@ client3_3_readv (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
rsp_iobuf = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (args->size > rsp_vec.iov_len) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_NO_MEMORY,
|
|
|
cb8e9e |
"read-size (%lu) is bigger than iobuf size (%lu)",
|
|
|
cb8e9e |
(unsigned long)args->size,
|
|
|
cb8e9e |
(unsigned long)rsp_vec.iov_len);
|
|
|
cb8e9e |
@@ -4180,7 +4336,8 @@ client3_3_readv (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_read_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
//unwind is done in the cbk
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4253,7 +4410,8 @@ client3_3_writev (call_frame_t *frame, xlator_t *this, void *data)
|
|
|
cb8e9e |
* do the unwind for us (see rpc_clnt_submit), so don't unwind
|
|
|
cb8e9e |
* here in such cases.
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4312,7 +4470,8 @@ client3_3_flush (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_flush_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4361,7 +4520,8 @@ client3_3_fsync (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_fsync_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4409,7 +4569,8 @@ client3_3_fstat (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_fstat_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4474,7 +4635,8 @@ client3_3_opendir (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_opendir_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4525,7 +4687,8 @@ client3_3_fsyncdir (call_frame_t *frame, xlator_t *this, void *data)
|
|
|
cb8e9e |
NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_fsyncdir_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4581,7 +4744,8 @@ client3_3_statfs (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_statfs_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4642,7 +4806,8 @@ client3_3_setxattr (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_setxattr_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
GF_FREE (req.dict.dict_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4699,7 +4864,8 @@ client3_3_fsetxattr (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_fsetxattr_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.dict.dict_val);
|
|
|
cb8e9e |
@@ -4795,7 +4961,8 @@ client3_3_fgetxattr (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, local->iobref,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_fgetxattr_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -4908,8 +5075,9 @@ client3_3_getxattr (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
args->loc->inode,
|
|
|
cb8e9e |
dict);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "Client dump locks failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY, "Client dump "
|
|
|
cb8e9e |
+ "locks failed");
|
|
|
cb8e9e |
op_errno = EINVAL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -4930,7 +5098,8 @@ client3_3_getxattr (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, local->iobref,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_getxattr_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5038,7 +5207,8 @@ client3_3_xattrop (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, local->iobref,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_xattrop_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.dict.dict_val);
|
|
|
cb8e9e |
@@ -5141,7 +5311,8 @@ client3_3_fxattrop (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, local->iobref,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_fxattrop_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.dict.dict_val);
|
|
|
cb8e9e |
@@ -5205,7 +5376,8 @@ client3_3_removexattr (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_removexattr_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5255,7 +5427,8 @@ client3_3_fremovexattr (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_fremovexattr_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5300,8 +5473,8 @@ client3_3_lk (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
ret = client_cmd_to_gf_cmd (args->cmd, &gf_cmd);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
op_errno = EINVAL;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "Unknown cmd (%d)!", gf_cmd);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY, "Unknown cmd (%d)!", gf_cmd);
|
|
|
cb8e9e |
goto unwind;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5336,7 +5509,8 @@ client3_3_lk (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_lk_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5384,8 +5558,8 @@ client3_3_inodelk (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
else if (args->cmd == F_SETLKW || args->cmd == F_SETLKW64)
|
|
|
cb8e9e |
gf_cmd = GF_LK_SETLKW;
|
|
|
cb8e9e |
else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "Unknown cmd (%d)!", gf_cmd);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY, "Unknown cmd (%d)!", gf_cmd);
|
|
|
cb8e9e |
op_errno = EINVAL;
|
|
|
cb8e9e |
goto unwind;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -5418,7 +5592,8 @@ client3_3_inodelk (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_inodelk_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5466,8 +5641,8 @@ client3_3_finodelk (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
else if (args->cmd == F_SETLKW || args->cmd == F_SETLKW64)
|
|
|
cb8e9e |
gf_cmd = GF_LK_SETLKW;
|
|
|
cb8e9e |
else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "Unknown cmd (%d)!", gf_cmd);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY, "Unknown cmd (%d)!", gf_cmd);
|
|
|
cb8e9e |
goto unwind;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -5499,7 +5674,8 @@ client3_3_finodelk (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_finodelk_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5558,7 +5734,8 @@ client3_3_entrylk (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_entrylk_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5613,7 +5790,8 @@ client3_3_fentrylk (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_fentrylk_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5661,7 +5839,8 @@ client3_3_rchecksum (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
0, NULL,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_rchecksum_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5759,7 +5938,8 @@ client3_3_readdir (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_readdir_req);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5864,7 +6044,8 @@ client3_3_readdirp (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
0, rsp_iobref,
|
|
|
cb8e9e |
(xdrproc_t)xdr_gfs3_readdirp_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.dict.dict_val);
|
|
|
cb8e9e |
@@ -5924,7 +6105,8 @@ client3_3_setattr (call_frame_t *frame, xlator_t *this,
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_setattr_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -5969,7 +6151,8 @@ client3_3_fsetattr (call_frame_t *frame, xlator_t *this, void *data)
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_fsetattr_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -6016,7 +6199,8 @@ client3_3_fallocate(call_frame_t *frame, xlator_t *this, void *data)
|
|
|
cb8e9e |
NULL, 0, NULL, 0,
|
|
|
cb8e9e |
NULL, (xdrproc_t)xdr_gfs3_fallocate_req);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
@@ -6061,7 +6245,8 @@ client3_3_discard(call_frame_t *frame, xlator_t *this, void *data)
|
|
|
cb8e9e |
NULL, NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t) xdr_gfs3_discard_req);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -6107,7 +6292,8 @@ client3_3_zerofill(call_frame_t *frame, xlator_t *this, void *data)
|
|
|
cb8e9e |
NULL, NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t) xdr_gfs3_zerofill_req);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -6146,7 +6332,8 @@ client3_3_ipc (call_frame_t *frame, xlator_t *this, void *data)
|
|
|
cb8e9e |
NULL, NULL, 0, NULL, 0, NULL,
|
|
|
cb8e9e |
(xdrproc_t) xdr_gfs3_ipc_req);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING, "failed to send the fop");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FOP_SEND_FAILED,
|
|
|
cb8e9e |
+ "failed to send the fop");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_FREE (req.xdata.xdata_val);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
|
|
|
cb8e9e |
index 5745de0..fb45128 100644
|
|
|
cb8e9e |
--- a/xlators/protocol/client/src/client.c
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/client.c
|
|
|
cb8e9e |
@@ -25,6 +25,7 @@
|
|
|
cb8e9e |
#include "xdr-rpc.h"
|
|
|
cb8e9e |
#include "glusterfs3.h"
|
|
|
cb8e9e |
#include "gf-dirent.h"
|
|
|
cb8e9e |
+#include "client-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
extern rpc_clnt_prog_t clnt_handshake_prog;
|
|
|
cb8e9e |
extern rpc_clnt_prog_t clnt_dump_prog;
|
|
|
cb8e9e |
@@ -168,7 +169,7 @@ client_grace_timeout (void *data)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
pthread_mutex_unlock (&conf->lock);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_TIMER_EXPIRED,
|
|
|
cb8e9e |
"client grace timer expired, updating "
|
|
|
cb8e9e |
"the lk-version to %d", ver);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -188,12 +189,12 @@ client_register_grace_timer (xlator_t *this, clnt_conf_t *conf)
|
|
|
cb8e9e |
pthread_mutex_lock (&conf->lock);
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (conf->grace_timer || !conf->grace_timer_needed) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
- "Client grace timer is already set "
|
|
|
cb8e9e |
- "or a grace-timer has already time out, "
|
|
|
cb8e9e |
- "not registering a new timer");
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
+ "Client grace timer is already set "
|
|
|
cb8e9e |
+ "or a grace-timer has already time "
|
|
|
cb8e9e |
+ "out, not registering a new timer");
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_TIMER_REG,
|
|
|
cb8e9e |
"Registering a grace timer");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
conf->grace_timer_needed = _gf_false;
|
|
|
cb8e9e |
@@ -247,8 +248,8 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame,
|
|
|
cb8e9e |
(procnum == GF_HNDSK_SETVOLUME))))) {
|
|
|
cb8e9e |
/* This particular error captured/logged in
|
|
|
cb8e9e |
functions calling this */
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "connection in disconnected state");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "connection in disconnected state");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -267,16 +268,18 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame,
|
|
|
cb8e9e |
if (iobref != NULL) {
|
|
|
cb8e9e |
ret = iobref_merge (new_iobref, iobref);
|
|
|
cb8e9e |
if (ret != 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "cannot merge iobref passed from caller "
|
|
|
cb8e9e |
- "into new_iobref");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
|
|
|
cb8e9e |
+ PC_MSG_NO_MEMORY, "cannot merge "
|
|
|
cb8e9e |
+ "iobref passed from caller into "
|
|
|
cb8e9e |
+ "new_iobref");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = iobref_add (new_iobref, iobuf);
|
|
|
cb8e9e |
if (ret != 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "cannot add iobuf into iobref");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
|
|
|
cb8e9e |
+ PC_MSG_NO_MEMORY, "cannot add iobuf into "
|
|
|
cb8e9e |
+ "iobref");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -314,7 +317,7 @@ client_submit_request (xlator_t *this, void *req, call_frame_t *frame,
|
|
|
cb8e9e |
rsp_payload, rsp_payload_count, rsp_iobref);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "rpc_clnt_submit failed");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "rpc_clnt_submit failed");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!conf->send_gids) {
|
|
|
cb8e9e |
@@ -371,14 +374,13 @@ client_releasedir (xlator_t *this, fd_t *fd)
|
|
|
cb8e9e |
args.fd = fd;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_RELEASEDIR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn) {
|
|
|
cb8e9e |
ret = proc->fn (NULL, this, &args);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "releasedir fop failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_DIR_OP_FAILED, "releasedir fop failed");
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -396,13 +398,12 @@ client_release (xlator_t *this, fd_t *fd)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
args.fd = fd;
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_RELEASE];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn) {
|
|
|
cb8e9e |
ret = proc->fn (NULL, this, &args);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_FILE_OP_FAILED,
|
|
|
cb8e9e |
"release fop failed");
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -425,7 +426,6 @@ client_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_LOOKUP];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -454,7 +454,6 @@ client_stat (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_STAT];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -483,7 +482,6 @@ client_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_TRUNCATE];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -513,7 +511,6 @@ client_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FTRUNCATE];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -543,7 +540,6 @@ client_access (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_ACCESS];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -574,7 +570,6 @@ client_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_READLINK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -605,7 +600,6 @@ client_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_MKNOD];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -636,7 +630,6 @@ client_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_MKDIR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -667,7 +660,6 @@ client_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.flags = xflag;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_UNLINK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -696,7 +688,6 @@ client_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_RMDIR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -728,7 +719,6 @@ client_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_SYMLINK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -759,7 +749,6 @@ client_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_RENAME];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -790,7 +779,6 @@ client_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_LINK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -828,7 +816,6 @@ client_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
|
|
|
cb8e9e |
args.flags = (flags & ~O_DIRECT);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_CREATE];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -864,7 +851,6 @@ client_open (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.flags = (flags & ~O_DIRECT);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_OPEN];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -897,7 +883,6 @@ client_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_READ];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -936,7 +921,6 @@ client_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_WRITE];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -963,7 +947,6 @@ client_flush (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FLUSH];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -993,7 +976,6 @@ client_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FSYNC];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1021,7 +1003,6 @@ client_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FSTAT];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1051,7 +1032,6 @@ client_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_OPENDIR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1080,7 +1060,6 @@ client_fsyncdir (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, d
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FSYNCDIR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1108,7 +1087,6 @@ client_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_STATFS];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1126,13 +1104,13 @@ is_client_rpc_init_command (dict_t *dict, xlator_t *this,
|
|
|
cb8e9e |
int dict_ret = -1;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!strstr (this->name, "replace-brick")) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "name is !replace-brick");
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "name is !replace-brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
dict_ret = dict_get_str (dict, CLIENT_CMD_CONNECT, value);
|
|
|
cb8e9e |
if (dict_ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "key %s not present",
|
|
|
cb8e9e |
- CLIENT_CMD_CONNECT);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "key %s not present",
|
|
|
cb8e9e |
+ CLIENT_CMD_CONNECT);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1151,14 +1129,14 @@ is_client_rpc_destroy_command (dict_t *dict, xlator_t *this)
|
|
|
cb8e9e |
char *dummy = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (strncmp (this->name, "replace-brick", 13)) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "name is !replace-brick");
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "name is !replace-brick");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
dict_ret = dict_get_str (dict, CLIENT_CMD_DISCONNECT, &dummy);
|
|
|
cb8e9e |
if (dict_ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE, "key %s not present",
|
|
|
cb8e9e |
- CLIENT_CMD_DISCONNECT);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0, "key %s not present",
|
|
|
cb8e9e |
+ CLIENT_CMD_DISCONNECT);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1188,8 +1166,9 @@ client_set_remote_options (char *value, xlator_t *this)
|
|
|
cb8e9e |
remote_port_str = strtok_r (NULL, ":", &tmp);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!subvol) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "proper value not passed as subvolume");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY, "proper value not passed as "
|
|
|
cb8e9e |
+ "subvolume");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1200,7 +1179,7 @@ client_set_remote_options (char *value, xlator_t *this)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr (this->options, "remote-host", host_dup);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"failed to set remote-host with %s", host);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1212,7 +1191,7 @@ client_set_remote_options (char *value, xlator_t *this)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_dynstr (this->options, "remote-subvolume", subvol_dup);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"failed to set remote-host with %s", host);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1223,7 +1202,7 @@ client_set_remote_options (char *value, xlator_t *this)
|
|
|
cb8e9e |
ret = dict_set_int32 (this->options, "remote-port",
|
|
|
cb8e9e |
remote_port);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_DICT_SET_FAILED,
|
|
|
cb8e9e |
"failed to set remote-port to %d", remote_port);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1252,7 +1231,8 @@ client_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (is_client_rpc_init_command (dict, this, &value) == _gf_true) {
|
|
|
cb8e9e |
GF_ASSERT (value);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO, "client rpc init command");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_RPC_INIT,
|
|
|
cb8e9e |
+ "client rpc init command");
|
|
|
cb8e9e |
ret = client_set_remote_options (value, this);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
(void) client_destroy_rpc (this);
|
|
|
cb8e9e |
@@ -1268,7 +1248,8 @@ client_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (is_client_rpc_destroy_command (dict, this) == _gf_true) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO, "client rpc destroy command");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_RPC_DESTROY,
|
|
|
cb8e9e |
+ "client rpc destroy command");
|
|
|
cb8e9e |
ret = client_destroy_rpc (this);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
op_ret = 0;
|
|
|
cb8e9e |
@@ -1291,7 +1272,6 @@ client_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_SETXATTR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn) {
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
@@ -1326,7 +1306,6 @@ client_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FSETXATTR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1357,7 +1336,6 @@ client_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FGETXATTR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1387,7 +1365,6 @@ client_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_GETXATTR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1418,7 +1395,6 @@ client_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_XATTROP];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1449,7 +1425,6 @@ client_fxattrop (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FXATTROP];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1479,7 +1454,6 @@ client_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_REMOVEXATTR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1507,7 +1481,6 @@ client_fremovexattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FREMOVEXATTR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1536,7 +1509,6 @@ client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_LK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1567,7 +1539,6 @@ client_inodelk (call_frame_t *frame, xlator_t *this, const char *volume,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_INODELK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1599,7 +1570,6 @@ client_finodelk (call_frame_t *frame, xlator_t *this, const char *volume,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FINODELK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1632,7 +1602,6 @@ client_entrylk (call_frame_t *frame, xlator_t *this, const char *volume,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_ENTRYLK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1666,7 +1635,6 @@ client_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FENTRYLK];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1696,7 +1664,6 @@ client_rchecksum (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_RCHECKSUM];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1728,7 +1695,6 @@ client_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_READDIR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1761,7 +1727,6 @@ client_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = dict;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_READDIRP];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1791,7 +1756,6 @@ client_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_SETATTR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1820,7 +1784,6 @@ client_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FSETATTR];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1850,7 +1813,6 @@ client_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_FALLOCATE];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1879,7 +1841,6 @@ client_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_DISCARD];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1908,7 +1869,6 @@ client_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_ZEROFILL];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1936,12 +1896,6 @@ client_ipc (call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata)
|
|
|
cb8e9e |
args.xdata = xdata;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_IPC];
|
|
|
cb8e9e |
- if (!proc) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "rpc procedure not found for %s",
|
|
|
cb8e9e |
- gf_fop_list[GF_FOP_IPC]);
|
|
|
cb8e9e |
- goto out;
|
|
|
cb8e9e |
- }
|
|
|
cb8e9e |
if (proc->fn)
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -1970,7 +1924,6 @@ client_getspec (call_frame_t *frame, xlator_t *this, const char *key,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* For all other xlators, getspec is an fop, hence its in fops table */
|
|
|
cb8e9e |
proc = &conf->fops->proctable[GF_FOP_GETSPEC];
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
if (proc->fn) {
|
|
|
cb8e9e |
/* But at protocol level, this is handshake */
|
|
|
cb8e9e |
ret = proc->fn (frame, this, &args);
|
|
|
cb8e9e |
@@ -2015,7 +1968,7 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
this = mydata;
|
|
|
cb8e9e |
if (!this || !this->private) {
|
|
|
cb8e9e |
- gf_log ("client", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("client", GF_LOG_ERROR, EINVAL, PC_MSG_INVALID_ENTRY,
|
|
|
cb8e9e |
(this != NULL) ?
|
|
|
cb8e9e |
"private structure of the xlator is NULL":
|
|
|
cb8e9e |
"xlator is NULL");
|
|
|
cb8e9e |
@@ -2032,20 +1985,22 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
|
|
|
cb8e9e |
ret = dict_get_str (this->options, "disable-handshake",
|
|
|
cb8e9e |
&handshake);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "got RPC_CLNT_CONNECT");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "got RPC_CLNT_CONNECT");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if ((ret < 0) || (strcasecmp (handshake, "on"))) {
|
|
|
cb8e9e |
ret = client_handshake (this, rpc);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "handshake msg returned %d", ret);
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_HANDSHAKE_RETURN, "handshake "
|
|
|
cb8e9e |
+ "msg returned %d", ret);
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
//conf->rpc->connected = 1;
|
|
|
cb8e9e |
ret = client_notify_dispatch_uniq (this,
|
|
|
cb8e9e |
GF_EVENT_CHILD_UP,
|
|
|
cb8e9e |
NULL);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_CHILD_UP_NOTIFY_FAILED,
|
|
|
cb8e9e |
"CHILD_UP notify failed");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2055,7 +2010,8 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
|
|
|
cb8e9e |
conf->grace_timer_needed = _gf_true;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (conf->grace_timer) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_GRACE_TIMER_CANCELLED,
|
|
|
cb8e9e |
"Cancelling the grace timer");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
gf_timer_call_cancel (this->ctx,
|
|
|
cb8e9e |
@@ -2076,19 +2032,26 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!conf->skip_notify) {
|
|
|
cb8e9e |
if (conf->connected) {
|
|
|
cb8e9e |
- gf_log (this->name,
|
|
|
cb8e9e |
- ((!conf->disconnect_err_logged)
|
|
|
cb8e9e |
- ? GF_LOG_INFO : GF_LOG_DEBUG),
|
|
|
cb8e9e |
- "disconnected from %s. Client process "
|
|
|
cb8e9e |
- "will keep trying to connect to "
|
|
|
cb8e9e |
- "glusterd until brick's port is "
|
|
|
cb8e9e |
- "available",
|
|
|
cb8e9e |
- conf->rpc->conn.name);
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
+ if (!conf->disconnect_err_logged) {
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_CLIENT_DISCONNECTED,
|
|
|
cb8e9e |
+ "disconnected from %s. Client "
|
|
|
cb8e9e |
+ "process will keep trying to "
|
|
|
cb8e9e |
+ "connect to glusterd until "
|
|
|
cb8e9e |
+ "brick's port is available",
|
|
|
cb8e9e |
+ conf->rpc->conn.name);
|
|
|
cb8e9e |
+ } else {
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "disconnected from %s. "
|
|
|
cb8e9e |
+ "Client process will keep"
|
|
|
cb8e9e |
+ " trying to connect to "
|
|
|
cb8e9e |
+ "glusterd until brick's "
|
|
|
cb8e9e |
+ "port is available",
|
|
|
cb8e9e |
+ conf->rpc->conn.name);
|
|
|
cb8e9e |
+ }
|
|
|
cb8e9e |
if (conf->portmap_err_logged)
|
|
|
cb8e9e |
conf->disconnect_err_logged = 1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
/* If the CHILD_DOWN event goes to parent xlator
|
|
|
cb8e9e |
multiple times, the logic of parent xlator notify
|
|
|
cb8e9e |
may get screwed up.. (eg. CHILD_MODIFIED event in
|
|
|
cb8e9e |
@@ -2098,13 +2061,14 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
|
|
|
cb8e9e |
GF_EVENT_CHILD_DOWN,
|
|
|
cb8e9e |
NULL);
|
|
|
cb8e9e |
if (ret)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ PC_MSG_CHILD_DOWN_NOTIFY_FAILED,
|
|
|
cb8e9e |
"CHILD_DOWN notify failed");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
if (conf->connected)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "disconnected (skipped notify)");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "disconnected (skipped notify)");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
conf->connected = 0;
|
|
|
cb8e9e |
@@ -2126,8 +2090,8 @@ client_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
default:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_TRACE,
|
|
|
cb8e9e |
- "got some other RPC event %d", event);
|
|
|
cb8e9e |
+ gf_msg_trace (this->name, 0,
|
|
|
cb8e9e |
+ "got some other RPC event %d", event);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2149,7 +2113,7 @@ notify (xlator_t *this, int32_t event, void *data, ...)
|
|
|
cb8e9e |
switch (event) {
|
|
|
cb8e9e |
case GF_EVENT_PARENT_UP:
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_PARENT_UP,
|
|
|
cb8e9e |
"parent translators are ready, attempting connect "
|
|
|
cb8e9e |
"on transport");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2158,7 +2122,7 @@ notify (xlator_t *this, int32_t event, void *data, ...)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
case GF_EVENT_PARENT_DOWN:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, 0, PC_MSG_PARENT_DOWN,
|
|
|
cb8e9e |
"current graph is no longer active, destroying "
|
|
|
cb8e9e |
"rpc_client ");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2172,8 +2136,8 @@ notify (xlator_t *this, int32_t event, void *data, ...)
|
|
|
cb8e9e |
break;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
default:
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "got %d, calling default_notify ()", event);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "got %d, calling default_notify ()", event);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
default_notify (this, event, data);
|
|
|
cb8e9e |
conf->last_sent_event = event;
|
|
|
cb8e9e |
@@ -2191,20 +2155,23 @@ client_check_remote_host (xlator_t *this, dict_t *options)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_str (options, "remote-host", &remote_host);
|
|
|
cb8e9e |
if (ret < 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_INFO, "Remote host is not set. "
|
|
|
cb8e9e |
- "Assuming the volfile server as remote host.");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_INFO, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_DICT_GET_FAILED, "Remote host is not set. "
|
|
|
cb8e9e |
+ "Assuming the volfile server as remote host");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!this->ctx->cmd_args.volfile_server) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "No remote host to connect.");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_DICT_GET_FAILED, "No remote host to "
|
|
|
cb8e9e |
+ "connect.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_set_str (options, "remote-host",
|
|
|
cb8e9e |
this->ctx->cmd_args.volfile_server);
|
|
|
cb8e9e |
if (ret == -1) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "Failed to set the remote host");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ PC_MSG_DICT_GET_FAILED, "Failed to set the "
|
|
|
cb8e9e |
+ "remote host");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2234,7 +2201,8 @@ build_client_config (xlator_t *this, clnt_conf_t *conf)
|
|
|
cb8e9e |
GF_OPTION_INIT ("remote-subvolume", conf->opt.remote_subvolume,
|
|
|
cb8e9e |
path, out);
|
|
|
cb8e9e |
if (!conf->opt.remote_subvolume)
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY,
|
|
|
cb8e9e |
"option 'remote-subvolume' not given");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
GF_OPTION_INIT ("filter-O_DIRECT", conf->filter_o_direct,
|
|
|
cb8e9e |
@@ -2265,8 +2233,8 @@ mem_acct_init (xlator_t *this)
|
|
|
cb8e9e |
ret = xlator_mem_acct_init (this, gf_client_mt_end + 1);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (ret != 0) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "Memory accounting init"
|
|
|
cb8e9e |
- "failed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM, PC_MSG_NO_MEMORY,
|
|
|
cb8e9e |
+ "Memory accounting init failed");
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2289,12 +2257,12 @@ client_destroy_rpc (xlator_t *this)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
conf->rpc = rpc_clnt_unref (conf->rpc);
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "Client rpc conn destroyed");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0,
|
|
|
cb8e9e |
+ "Client rpc conn destroyed");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0, PC_MSG_RPC_INVALID_CALL,
|
|
|
cb8e9e |
"RPC destroy called on already destroyed "
|
|
|
cb8e9e |
"connection");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2311,21 +2279,24 @@ client_init_rpc (xlator_t *this)
|
|
|
cb8e9e |
conf = this->private;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (conf->rpc) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "client rpc already init'ed");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ PC_MSG_RPC_INITED_ALREADY, "client rpc already "
|
|
|
cb8e9e |
+ "init'ed");
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
conf->rpc = rpc_clnt_new (this->options, this->ctx, this->name, 0);
|
|
|
cb8e9e |
if (!conf->rpc) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "failed to initialize RPC");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_INIT_FAILED,
|
|
|
cb8e9e |
+ "failed to initialize RPC");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = rpc_clnt_register_notify (conf->rpc, client_rpc_notify, this);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR, "failed to register notify");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_NOTIFY_FAILED,
|
|
|
cb8e9e |
+ "failed to register notify");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -2335,14 +2306,14 @@ client_init_rpc (xlator_t *this)
|
|
|
cb8e9e |
ret = rpcclnt_cbk_program_register (conf->rpc, &gluster_cbk_prog,
|
|
|
cb8e9e |
this);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, 0, PC_MSG_RPC_CBK_FAILED,
|
|
|
cb8e9e |
"failed to register callback program");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "client init successful");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "client init successful");
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -2367,8 +2338,8 @@ client_init_grace_timer (xlator_t *this, dict_t *options,
|
|
|
cb8e9e |
if (!ret)
|
|
|
cb8e9e |
gf_string2boolean (lk_heal, &conf->lk_heal);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "lk-heal = %s",
|
|
|
cb8e9e |
- (conf->lk_heal) ? "on" : "off");
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "lk-heal = %s",
|
|
|
cb8e9e |
+ (conf->lk_heal) ? "on" : "off");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = dict_get_int32 (options, "grace-timeout", &grace_timeout);
|
|
|
cb8e9e |
if (!ret)
|
|
|
cb8e9e |
@@ -2380,8 +2351,8 @@ client_init_grace_timer (xlator_t *this, dict_t *options,
|
|
|
cb8e9e |
|
|
|
cb8e9e |
gf_time_fmt (timestr, sizeof timestr, conf->grace_ts.tv_sec,
|
|
|
cb8e9e |
gf_timefmt_s);
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_DEBUG, "Client grace timeout value = %s",
|
|
|
cb8e9e |
- timestr);
|
|
|
cb8e9e |
+ gf_msg_debug (this->name, 0, "Client grace timeout value = %s",
|
|
|
cb8e9e |
+ timestr);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = 0;
|
|
|
cb8e9e |
out:
|
|
|
cb8e9e |
@@ -2482,15 +2453,15 @@ init (xlator_t *this)
|
|
|
cb8e9e |
clnt_conf_t *conf = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (this->children) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
- "FATAL: client protocol translator cannot have any "
|
|
|
cb8e9e |
- "subvolumes");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY, "FATAL: client protocol "
|
|
|
cb8e9e |
+ "translator cannot have any subvolumes");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!this->parents) {
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "Volume is dangling. ");
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ PC_MSG_INVALID_ENTRY, "Volume is dangling. ");
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
conf = GF_CALLOC (1, sizeof (*conf), gf_client_mt_clnt_conf_t);
|
|
|
cb8e9e |
@@ -2540,7 +2511,7 @@ init (xlator_t *this)
|
|
|
cb8e9e |
this->local_pool = mem_pool_new (clnt_local_t, 64);
|
|
|
cb8e9e |
if (!this->local_pool) {
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg (this->name, GF_LOG_ERROR, ENOMEM, PC_MSG_NO_MEMORY,
|
|
|
cb8e9e |
"failed to create local_t's memory pool");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
|
|
|
cb8e9e |
index 40200b6..38f34d5 100644
|
|
|
cb8e9e |
--- a/xlators/protocol/client/src/client.h
|
|
|
cb8e9e |
+++ b/xlators/protocol/client/src/client.h
|
|
|
cb8e9e |
@@ -48,7 +48,8 @@ typedef enum {
|
|
|
cb8e9e |
goto label; \
|
|
|
cb8e9e |
} \
|
|
|
cb8e9e |
if (remote_fd == -1) { \
|
|
|
cb8e9e |
- gf_log (xl->name, GF_LOG_WARNING, " (%s) " \
|
|
|
cb8e9e |
+ gf_msg (xl->name, GF_LOG_WARNING, EBADFD, \
|
|
|
cb8e9e |
+ PC_MSG_BAD_FD, " (%s) " \
|
|
|
cb8e9e |
"remote_fd is -1. EBADFD", \
|
|
|
cb8e9e |
uuid_utoa (fd->inode->gfid)); \
|
|
|
cb8e9e |
op_errno = EBADFD; \
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|