summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/gf-dirent.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 /libglusterfs/src/gf-dirent.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 'libglusterfs/src/gf-dirent.c')
-rw-r--r--libglusterfs/src/gf-dirent.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libglusterfs/src/gf-dirent.c b/libglusterfs/src/gf-dirent.c
index 4a7220d9693..e3c1f1b9004 100644
--- a/libglusterfs/src/gf-dirent.c
+++ b/libglusterfs/src/gf-dirent.c
@@ -75,7 +75,8 @@ gf_dirent_for_name (const char *name)
gf_dirent_t *gf_dirent = NULL;
/* TODO: use mem-pool */
- gf_dirent = CALLOC (gf_dirent_size (name), 1);
+ gf_dirent = GF_CALLOC (gf_dirent_size (name), 1,
+ gf_common_mt_gf_dirent_t);
if (!gf_dirent)
return NULL;
@@ -105,7 +106,7 @@ gf_dirent_free (gf_dirent_t *entries)
list_for_each_entry_safe (entry, tmp, &entries->list, list) {
list_del (&entry->list);
- FREE (entry);
+ GF_FREE (entry);
}
}
@@ -165,7 +166,7 @@ gf_dirent_unserialize (gf_dirent_t *entries, const char *buf, size_t buf_size)
}
entry_len = sizeof (gf_dirent_t) + entry_strlen + 1;
- entry = CALLOC (1, entry_len);
+ entry = GF_CALLOC (1, entry_len, gf_common_mt_gf_dirent_t);
if (!entry) {
break;
}