summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/saved-frames.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-04-22 13:33:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-23 06:32:52 -0700
commit582de0677da4be19fc6f873625c58c45d069ab1c (patch)
treef10cb3e26e1f92f6ea91034e6f7bb925790dd9bc /xlators/protocol/client/src/saved-frames.c
parent72baa17282f5cf749fa743fd601c7b728ece4fa2 (diff)
Memory accounting changes
Memory accounting Changes. Thanks to Vinayak Hegde and Csaba Henk for their contributions. Signed-off-by: Vijay Bellur <vijay@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 'xlators/protocol/client/src/saved-frames.c')
-rw-r--r--xlators/protocol/client/src/saved-frames.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/xlators/protocol/client/src/saved-frames.c b/xlators/protocol/client/src/saved-frames.c
index cd5349e21..770de19ad 100644
--- a/xlators/protocol/client/src/saved-frames.c
+++ b/xlators/protocol/client/src/saved-frames.c
@@ -22,6 +22,7 @@
#include "common-utils.h"
#include "protocol.h"
#include "xlator.h"
+#include "client-mem-types.h"
@@ -30,7 +31,8 @@ saved_frames_new (void)
{
struct saved_frames *saved_frames = NULL;
- saved_frames = CALLOC (sizeof (*saved_frames), 1);
+ saved_frames = GF_CALLOC (sizeof (*saved_frames), 1,
+ gf_client_mt_saved_frames);
if (!saved_frames) {
return NULL;
}
@@ -76,7 +78,8 @@ saved_frames_put (struct saved_frames *frames, call_frame_t *frame,
head_frame = get_head_frame_for_type (frames, type);
- saved_frame = CALLOC (sizeof (*saved_frame), 1);
+ saved_frame = GF_CALLOC (sizeof (*saved_frame), 1,
+ gf_client_mt_saved_frame);
if (!saved_frame) {
return -ENOMEM;
}
@@ -119,7 +122,7 @@ saved_frames_get (struct saved_frames *frames, int32_t op,
if (saved_frame)
frame = saved_frame->frame;
- FREE (saved_frame);
+ GF_FREE (saved_frame);
return frame;
}
@@ -174,7 +177,7 @@ saved_frames_unwind (xlator_t *this, struct saved_frames *saved_frames,
gf_ops[trav->op] (frame, &hdr, sizeof (hdr), NULL);
list_del_init (&trav->list);
- FREE (trav);
+ GF_FREE (trav);
}
}
@@ -187,5 +190,5 @@ saved_frames_destroy (xlator_t *this, struct saved_frames *frames,
saved_frames_unwind (this, frames, &frames->mops, gf_mops, gf_mop_list);
saved_frames_unwind (this, frames, &frames->cbks, gf_cbks, gf_cbk_list);
- FREE (frames);
+ GF_FREE (frames);
}