summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-08-10 16:58:38 +0530
committerVijay Bellur <vijay@gluster.com>2011-08-25 12:01:08 -0700
commitcd567c063ec25b280d3fb5686a69b068c2d6d6df (patch)
tree636ed83dc9b7e4d7e019dcfc59bbc722f066e2e6 /rpc
parent9c68f3b53ffd27ea03e90da883c43e84bf94dd15 (diff)
mem-pool: Make mem-pool ptr avialable in ptr
The header of the ptr returned from mem-pool will now store the mem-pool ptr it belongs to. mem_put will now take only the pointer to be freed. Also, changing MALLOC call to GF_CALLOC in mem_get when we run out of entries in mem-pool. This also will have the header information saved. Change-Id: I3de182663a7f5b49c9e9425e9531775b70bdff67 BUG: 3390 Reviewed-on: http://review.gluster.com/205 Reviewed-by: Amar Tumballi <amar@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c12
-rw-r--r--rpc/rpc-lib/src/rpcsvc.c2
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c8
3 files changed, 11 insertions, 11 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index 5545f7e2ebe..acc4b0e571b 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -117,7 +117,7 @@ saved_frames_delete (struct saved_frame *saved_frame,
conn->rpc_clnt->reqpool);
}
- mem_put (conn->rpc_clnt->saved_frames_pool, saved_frame);
+ mem_put (saved_frame);
out:
return;
}
@@ -201,7 +201,7 @@ call_bail (void *data)
rpc_clnt_reply_deinit (trav->rpcreq, clnt->reqpool);
list_del_init (&trav->list);
- mem_put (conn->rpc_clnt->saved_frames_pool, trav);
+ mem_put (trav);
}
out:
return;
@@ -347,7 +347,7 @@ saved_frames_unwind (struct saved_frames *saved_frames)
trav->rpcreq->conn->rpc_clnt->reqpool);
list_del_init (&trav->list);
- mem_put (saved_frames_pool, trav);
+ mem_put (trav);
}
}
@@ -601,7 +601,7 @@ rpc_clnt_reply_deinit (struct rpc_req *req, struct mem_pool *pool)
iobref_unref (req->rsp_iobref);
}
- mem_put (pool, req);
+ mem_put (req);
out:
return;
}
@@ -752,7 +752,7 @@ rpc_clnt_handle_reply (struct rpc_clnt *clnt, rpc_transport_pollin_t *pollin)
out:
if (saved_frame) {
- mem_put (conn->rpc_clnt->saved_frames_pool, saved_frame);
+ mem_put (saved_frame);
}
clnt = rpc_clnt_unref (clnt);
@@ -1461,7 +1461,7 @@ out:
if (rpcreq) {
rpcreq->rpc_status = -1;
cbkfn (rpcreq, NULL, 0, frame);
- mem_put (rpc->reqpool, rpcreq);
+ mem_put (rpcreq);
}
}
return ret;
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
index a8d3e84c9eb..245b41cabc1 100644
--- a/rpc/rpc-lib/src/rpcsvc.c
+++ b/rpc/rpc-lib/src/rpcsvc.c
@@ -276,7 +276,7 @@ rpcsvc_request_destroy (rpcsvc_request_t *req)
rpc_transport_unref (req->trans);
- mem_put (req->svc->rxpool, req);
+ mem_put (req);
out:
return;
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index d170c0d66d4..e881484600d 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -300,7 +300,7 @@ __rdma_ioq_entry_free (rdma_ioq_t *entry)
entry->msg.request.rsp_iobref = NULL;
}
/* TODO: use mem-pool */
- mem_put (entry->pool, entry);
+ mem_put (entry);
}
@@ -795,7 +795,7 @@ __rdma_request_context_destroy (rdma_request_context_t *context)
gf_log ("rdma", GF_LOG_DEBUG,
"failed to send "
"message");
- mem_put (context->pool, context);
+ mem_put (context);
__rdma_disconnect (peer->trans);
goto out;
}
@@ -811,7 +811,7 @@ __rdma_request_context_destroy (rdma_request_context_t *context)
context->rsp_iobref = NULL;
}
- mem_put (context->pool, context);
+ mem_put (context);
out:
return;
@@ -1602,7 +1602,7 @@ rdma_reply_info_destroy (rdma_reply_info_t *reply_info)
reply_info->wc_array = NULL;
}
- mem_put (reply_info->pool, reply_info);
+ mem_put (reply_info);
out:
return;
}