summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/rpc/rpc-lib/src/rpcsvc.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-06-24 07:58:51 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-06-25 03:16:36 -0700
commit29893bcba579f7e37a6ace018ffda1c8abe45550 (patch)
tree88cd08652635723569fb4401485e07a0460b43a5 /xlators/protocol/rpc/rpc-lib/src/rpcsvc.c
parentb8b2a9d2f49686d5056fb0ce6150cf9c54180b12 (diff)
added proper mem-types to GF_CALLOC in protocol
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875
Diffstat (limited to 'xlators/protocol/rpc/rpc-lib/src/rpcsvc.c')
-rw-r--r--xlators/protocol/rpc/rpc-lib/src/rpcsvc.c16
1 files changed, 10 insertions, 6 deletions
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;