summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/call-stub.c14
-rw-r--r--libglusterfs/src/call-stub.h1
-rw-r--r--libglusterfs/src/glusterfs.h2
3 files changed, 14 insertions, 3 deletions
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c
index 497637fa9dc..e505bf7fd3e 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;
}
diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h
index bc621ec83a5..a284ef929a7 100644
--- a/libglusterfs/src/call-stub.h
+++ b/libglusterfs/src/call-stub.h
@@ -34,6 +34,7 @@ typedef struct {
char wind;
call_frame_t *frame;
glusterfs_fop_t fop;
+ struct mem_pool *stub_mem_pool; /* pointer to stub mempool in glusterfs ctx */
union {
/* lookup */
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 8dc781d81ec..6f40b988024 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -275,6 +275,8 @@ struct _glusterfs_ctx {
void *mgmt; /* xlator implementing MOPs for centralized logging, volfile server */
unsigned char measure_latency; /* toggle switch for latency measurement */
pthread_t sigwaiter;
+ struct mem_pool *stub_mem_pool;
+
};
typedef struct _glusterfs_ctx glusterfs_ctx_t;