summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/call-stub.c
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2010-08-05 04:00:59 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-06 03:37:40 -0700
commite85069767b28fe12cf3dcc4ccf1a5cfc10753c4b (patch)
treea95b091bc59496463086baafcf48b0c14ec3ae07 /libglusterfs/src/call-stub.c
parentf9431f330e8f304e82d9b1443018987a926d56b6 (diff)
downloadglusterfs-e85069767b28fe12cf3dcc4ccf1a5cfc10753c4b.tar.gz
glusterfs-e85069767b28fe12cf3dcc4ccf1a5cfc10753c4b.tar.xz
glusterfs-e85069767b28fe12cf3dcc4ccf1a5cfc10753c4b.zip
mem pool for call_stub_t
Ran posix compliance test and sanity test Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 329 (Replacing memory allocation functions with mem-type functions) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=329
Diffstat (limited to 'libglusterfs/src/call-stub.c')
-rw-r--r--libglusterfs/src/call-stub.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
index 497637fa9d..e505bf7fd3 100644
--- a/libglusterfs/src/call-stub.c
+++ b/libglusterfs/src/call-stub.c
@@ -38,13 +38,14 @@ stub_new (call_frame_t *frame,
GF_VALIDATE_OR_GOTO ("call-stub", frame, out);
- new = GF_CALLOC (1, sizeof (*new), gf_common_mt_call_stub_t);
+ new = mem_get (frame->this->ctx->stub_mem_pool);
+ memset (new, 0, sizeof (call_stub_t));
GF_VALIDATE_OR_GOTO ("call-stub", new, out);
new->frame = frame;
new->wind = wind;
new->fop = fop;
-
+ new->stub_mem_pool = frame->this->ctx->stub_mem_pool;
INIT_LIST_HEAD (&new->list);
out:
return new;
@@ -3824,7 +3825,11 @@ call_stub_destroy_unwind (call_stub_t *stub)
void
call_stub_destroy (call_stub_t *stub)
{
+ struct mem_pool *tmp_pool = NULL;
+
GF_VALIDATE_OR_GOTO ("call-stub", stub, out);
+
+ tmp_pool = stub->stub_mem_pool;
if (stub->wind) {
call_stub_destroy_wind (stub);
@@ -3832,8 +3837,11 @@ call_stub_destroy (call_stub_t *stub)
call_stub_destroy_unwind (stub);
}
- GF_FREE (stub);
+ stub->stub_mem_pool = NULL;
+ mem_put (tmp_pool, stub);
out:
+ tmp_pool = NULL;
+
return;
}