summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/rpc/rpc-lib/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/rpc/rpc-lib/src')
-rw-r--r--xlators/protocol/rpc/rpc-lib/src/rpc-clnt.c10
-rw-r--r--xlators/protocol/rpc/rpc-lib/src/rpc-transport.c13
-rw-r--r--xlators/protocol/rpc/rpc-lib/src/rpcsvc-auth.c2
-rw-r--r--xlators/protocol/rpc/rpc-lib/src/rpcsvc.c16
4 files changed, 24 insertions, 17 deletions
diff --git a/xlators/protocol/rpc/rpc-lib/src/rpc-clnt.c b/xlators/protocol/rpc/rpc-lib/src/rpc-clnt.c
index da02b9f42..84fdb9bb5 100644
--- a/xlators/protocol/rpc/rpc-lib/src/rpc-clnt.c
+++ b/xlators/protocol/rpc/rpc-lib/src/rpc-clnt.c
@@ -68,7 +68,8 @@ __saved_frames_put (struct saved_frames *frames, void *frame, int32_t procnum,
{
struct saved_frame *saved_frame = NULL;
- saved_frame = GF_CALLOC (sizeof (*saved_frame), 1, 0);
+ saved_frame = GF_CALLOC (1, sizeof (*saved_frame),
+ gf_common_mt_rpcclnt_savedframe_t);
if (!saved_frame) {
gf_log ("rpc-clnt", GF_LOG_ERROR, "out of memory");
goto out;
@@ -234,7 +235,8 @@ saved_frames_new (void)
{
struct saved_frames *saved_frames = NULL;
- saved_frames = GF_CALLOC (sizeof (*saved_frames), 1, 0);
+ saved_frames = GF_CALLOC (1, sizeof (*saved_frames),
+ gf_common_mt_rpcclnt_savedframe_t);
if (!saved_frames) {
gf_log ("rpc-clnt", GF_LOG_ERROR, "out of memory");
return NULL;
@@ -876,13 +878,14 @@ rpc_clnt_init (struct rpc_clnt_config *config, dict_t *options,
int ret = -1;
struct rpc_clnt *rpc = NULL;
- rpc = GF_CALLOC (1, sizeof (*rpc), 0);
+ rpc = GF_CALLOC (1, sizeof (*rpc), gf_common_mt_rpcclnt_t);
if (!rpc) {
gf_log ("rpc-clnt", GF_LOG_ERROR, "out of memory");
goto out;
}
pthread_mutex_init (&rpc->lock, NULL);
+ rpc->ctx = ctx;
ret = rpc_clnt_connection_init (rpc, ctx, options, name);
if (ret == -1) {
@@ -891,7 +894,6 @@ rpc_clnt_init (struct rpc_clnt_config *config, dict_t *options,
rpc = NULL;
goto out;
}
- rpc->ctx = ctx;
out:
return rpc;
}
diff --git a/xlators/protocol/rpc/rpc-lib/src/rpc-transport.c b/xlators/protocol/rpc/rpc-lib/src/rpc-transport.c
index 577158904..82ea9a74b 100644
--- a/xlators/protocol/rpc/rpc-lib/src/rpc-transport.c
+++ b/xlators/protocol/rpc/rpc-lib/src/rpc-transport.c
@@ -659,7 +659,7 @@ rpc_transport_pollin_alloc (rpc_transport_t *this, struct iobuf *iobuf,
size_t vectored_size, void *private)
{
rpc_transport_pollin_t *msg = NULL;
- msg = GF_CALLOC (1, sizeof (*msg), 0);
+ msg = GF_CALLOC (1, sizeof (*msg), gf_common_mt_rpc_trans_pollin_t);
if (!msg) {
gf_log ("rpc-transport", GF_LOG_ERROR, "out of memory");
goto out;
@@ -703,7 +703,7 @@ rpc_transport_same_process_pollin_alloc (rpc_transport_t *this,
goto err;
}
- msg = GF_CALLOC (1, sizeof (*msg), 0);
+ msg = GF_CALLOC (1, sizeof (*msg), gf_common_mt_rpc_trans_pollin_t);
if (!msg) {
gf_log ("rpc-transport", GF_LOG_ERROR, "out of memory");
goto err;
@@ -799,7 +799,7 @@ rpc_transport_handover_alloc (rpc_transport_pollin_t *pollin)
{
rpc_transport_handover_t *msg = NULL;
- msg = GF_CALLOC (1, sizeof (*msg), 0);
+ msg = GF_CALLOC (1, sizeof (*msg), gf_common_mt_rpc_trans_handover_t);
if (!msg) {
gf_log ("rpc_transport", GF_LOG_ERROR, "out of memory");
goto out;
@@ -846,7 +846,7 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name)
GF_VALIDATE_OR_GOTO("rpc-transport", ctx, fail);
GF_VALIDATE_OR_GOTO("rpc-transport", trans_name, fail);
- trans = GF_CALLOC (1, sizeof (struct rpc_transport), 0);
+ trans = GF_CALLOC (1, sizeof (struct rpc_transport), gf_common_mt_rpc_trans_t);
GF_VALIDATE_OR_GOTO("rpc-transport", trans, fail);
trans->name = gf_strdup (trans_name);
@@ -949,7 +949,8 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name)
goto fail;
}
- vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t), 0);
+ vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t),
+ gf_common_mt_volume_opt_list_t);
if (!vol_opt) {
gf_log (trans_name, GF_LOG_ERROR, "out of memory");
goto fail;
@@ -1017,7 +1018,7 @@ rpc_transport_submit_request (rpc_transport_t *this, rpc_transport_req_t *req)
if (this->peer_trans) {
peer_trans = this->peer_trans;
- rsp = GF_CALLOC (1, sizeof (*rsp), 0);
+ rsp = GF_CALLOC (1, sizeof (*rsp), gf_common_mt_rpc_trans_rsp_t);
if (!rsp) {
ret = -ENOMEM;
goto fail;
diff --git a/xlators/protocol/rpc/rpc-lib/src/rpcsvc-auth.c b/xlators/protocol/rpc/rpc-lib/src/rpcsvc-auth.c
index 50a55f5db..fa039c386 100644
--- a/xlators/protocol/rpc/rpc-lib/src/rpcsvc-auth.c
+++ b/xlators/protocol/rpc/rpc-lib/src/rpcsvc-auth.c
@@ -39,7 +39,7 @@ rpcsvc_auth_add_initer (struct list_head *list, char *idfier,
if ((!list) || (!init) || (!idfier))
return -1;
- new = GF_CALLOC (1, sizeof (*new), 0);
+ new = GF_CALLOC (1, sizeof (*new), gf_common_mt_rpcsvc_auth_list);
if (!new) {
gf_log (GF_RPCSVC, GF_LOG_ERROR, "Memory allocation failed");
return -1;
diff --git a/xlators/protocol/rpc/rpc-lib/src/rpcsvc.c b/xlators/protocol/rpc/rpc-lib/src/rpcsvc.c
index 1e0a05e45..e07cb8ee7 100644
--- a/xlators/protocol/rpc/rpc-lib/src/rpcsvc.c
+++ b/xlators/protocol/rpc/rpc-lib/src/rpcsvc.c
@@ -480,7 +480,7 @@ rpcsvc_conn_alloc (rpcsvc_t *svc, rpc_transport_t *trans)
int ret = -1;
unsigned int poolcount = 0;
- conn = GF_CALLOC (1, sizeof(*conn), 0);
+ conn = GF_CALLOC (1, sizeof(*conn), gf_common_mt_rpcsvc_conn_t);
if (!conn) {
gf_log (GF_RPCSVC, GF_LOG_ERROR, "memory allocation failed");
return NULL;
@@ -538,7 +538,7 @@ rpcsvc_notify_wrapper_alloc (void)
{
rpcsvc_notify_wrapper_t *wrapper = NULL;
- wrapper = GF_CALLOC (1, sizeof (*wrapper), 0);
+ wrapper = GF_CALLOC (1, sizeof (*wrapper), gf_common_mt_rpcsvc_wrapper_t);
if (!wrapper) {
gf_log (GF_RPCSVC, GF_LOG_ERROR, "memory allocation failed");
goto out;
@@ -609,7 +609,8 @@ rpcsvc_conn_destroy (rpcsvc_conn_t *conn)
pthread_mutex_lock (&svc->rpclock);
{
- wrappers = GF_CALLOC (svc->notify_count, sizeof (*wrapper), 0);
+ wrappers = GF_CALLOC (svc->notify_count, sizeof (*wrapper),
+ gf_common_mt_rpcsvc_wrapper_t);
if (!wrappers) {
goto unlock;
}
@@ -1181,6 +1182,8 @@ rpcsvc_handle_rpc_call (rpcsvc_conn_t *conn, rpc_transport_pollin_t *msg)
}
} else if (actor->actor) {
rpcsvc_conn_ref (req->conn);
+ /* Before going to xlator code, set the THIS properly */
+ THIS = conn->svc->mydata;
ret = actor->actor (req);
}
}
@@ -1761,7 +1764,8 @@ rpcsvc_listener_alloc (rpcsvc_t *svc, rpcsvc_conn_t *conn)
rpcsvc_listener_t *listener = NULL;
int ret = -1;
- listener = GF_CALLOC (1, sizeof (*listener), 0);
+ listener = GF_CALLOC (1, sizeof (*listener),
+ gf_common_mt_rpcsvc_listener_t);
if (!listener) {
gf_log (GF_RPCSVC, GF_LOG_ERROR, "memory allocation failed");
goto out;
@@ -1887,7 +1891,7 @@ rpcsvc_program_register (rpcsvc_t *svc, rpcsvc_program_t program)
if (!svc)
return -1;
- newprog = GF_CALLOC (1, sizeof(*newprog), 0);
+ newprog = GF_CALLOC (1, sizeof(*newprog), gf_common_mt_rpcsvc_program_t);
if (!newprog)
return -1;
@@ -1948,7 +1952,7 @@ rpcsvc_init (glusterfs_ctx_t *ctx, dict_t *options)
if ((!ctx) || (!options))
return NULL;
- svc = GF_CALLOC (1, sizeof (*svc), 0);
+ svc = GF_CALLOC (1, sizeof (*svc), gf_common_mt_rpcsvc_t);
if (!svc)
return NULL;