summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-dir-read.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/cluster/afr/src/afr-dir-read.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/cluster/afr/src/afr-dir-read.c')
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index 501cc3e8c58..0f9bdf59eae 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -188,8 +188,9 @@ afr_examine_dir (call_frame_t *frame, xlator_t *this)
local = frame->local;
priv = this->private;
- local->cont.opendir.checksum = CALLOC (priv->child_count,
- sizeof (*local->cont.opendir.checksum));
+ local->cont.opendir.checksum = GF_CALLOC (priv->child_count,
+ sizeof (*local->cont.opendir.checksum),
+ gf_afr_mt_int32_t);
call_count = afr_up_children_count (priv->child_count, local->child_up);
@@ -387,8 +388,8 @@ afr_remember_entries (gf_dirent_t *entries, fd_t *fd)
fd_ctx = (afr_fd_ctx_t *)(long) ctx;
list_for_each_entry (entry, &entries->list, list) {
- n = CALLOC (1, sizeof (*n));
- n->name = strdup (entry->d_name);
+ n = GF_CALLOC (1, sizeof (*n), gf_afr_mt_entry_name);
+ n->name = gf_strdup (entry->d_name);
INIT_LIST_HEAD (&n->list);
list_add (&n->list, &fd_ctx->entries);
@@ -421,7 +422,7 @@ afr_filter_entries (gf_dirent_t *entries, fd_t *fd)
if (remembered_name (entry->d_name, &fd_ctx->entries)) {
list_del (&entry->list);
- FREE (entry);
+ GF_FREE (entry);
}
}
@@ -448,9 +449,9 @@ afr_forget_entries (fd_t *fd)
fd_ctx = (afr_fd_ctx_t *)(long) ctx;
list_for_each_entry_safe (entry, tmp, &fd_ctx->entries, list) {
- FREE (entry->name);
+ GF_FREE (entry->name);
list_del (&entry->list);
- FREE (entry);
+ GF_FREE (entry);
}
}
@@ -485,7 +486,7 @@ afr_readdir_cbk (call_frame_t *frame, void *cookie,
if ((local->fd->inode == local->fd->inode->table->root)
&& !strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)) {
list_del_init (&entry->list);
- FREE (entry);
+ GF_FREE (entry);
}
}
}
@@ -571,7 +572,7 @@ afr_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if ((local->fd->inode == local->fd->inode->table->root)
&& !strcmp (entry->d_name, GF_REPLICATE_TRASH_DIR)) {
list_del_init (&entry->list);
- FREE (entry);
+ GF_FREE (entry);
}
}
}