summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-data.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-self-heal-data.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-self-heal-data.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index 2d74ed1e9..e29c1deff 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -387,7 +387,8 @@ afr_sh_data_erase_pending (call_frame_t *frame, xlator_t *this)
afr_sh_pending_to_delta (priv, sh->xattr, sh->delta_matrix, sh->success,
priv->child_count, AFR_DATA_TRANSACTION);
- erase_xattr = CALLOC (sizeof (*erase_xattr), priv->child_count);
+ erase_xattr = GF_CALLOC (sizeof (*erase_xattr), priv->child_count,
+ gf_afr_mt_dict_t);
for (i = 0; i < priv->child_count; i++) {
if (sh->xattr[i]) {
@@ -425,7 +426,7 @@ afr_sh_data_erase_pending (call_frame_t *frame, xlator_t *this)
dict_unref (erase_xattr[i]);
}
}
- FREE (erase_xattr);
+ GF_FREE (erase_xattr);
return 0;
}
@@ -766,13 +767,16 @@ afr_self_heal_get_source (xlator_t *this, afr_local_t *local, dict_t **xattr)
sh = &local->self_heal;
priv = this->private;
- sh->pending_matrix = CALLOC (sizeof (int32_t *), priv->child_count);
+ sh->pending_matrix = GF_CALLOC (sizeof (int32_t *), priv->child_count,
+ gf_afr_mt_int32_t);
for (i = 0; i < priv->child_count; i++) {
- sh->pending_matrix[i] = CALLOC (sizeof (int32_t),
- priv->child_count);
+ sh->pending_matrix[i] = GF_CALLOC (sizeof (int32_t),
+ priv->child_count,
+ gf_afr_mt_int32_t);
}
- sh->sources = CALLOC (priv->child_count, sizeof (*sh->sources));
+ sh->sources = GF_CALLOC (priv->child_count, sizeof (*sh->sources),
+ gf_afr_mt_int32_t);
afr_sh_build_pending_matrix (priv, sh->pending_matrix, xattr,
priv->child_count, AFR_DATA_TRANSACTION);