summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/nufa.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/dht/src/nufa.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/dht/src/nufa.c')
-rw-r--r--xlators/cluster/dht/src/nufa.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c
index edb900f763a..0d8241f41a5 100644
--- a/xlators/cluster/dht/src/nufa.c
+++ b/xlators/cluster/dht/src/nufa.c
@@ -513,21 +513,21 @@ fini (xlator_t *this)
if (conf) {
if (conf->file_layouts) {
for (i = 0; i < conf->subvolume_cnt; i++) {
- FREE (conf->file_layouts[i]);
+ GF_FREE (conf->file_layouts[i]);
}
- FREE (conf->file_layouts);
+ GF_FREE (conf->file_layouts);
}
if (conf->default_dir_layout)
- FREE (conf->default_dir_layout);
+ GF_FREE (conf->default_dir_layout);
if (conf->subvolumes)
- FREE (conf->subvolumes);
+ GF_FREE (conf->subvolumes);
if (conf->subvolume_status)
- FREE (conf->subvolume_status);
+ GF_FREE (conf->subvolume_status);
- FREE (conf);
+ GF_FREE (conf);
}
return;
@@ -557,7 +557,8 @@ init (xlator_t *this)
"dangling volume. check volfile");
}
- conf = CALLOC (1, sizeof (*conf));
+ conf = GF_CALLOC (1, sizeof (*conf),
+ gf_dht_mt_dht_conf_t);
if (!conf) {
gf_log (this->name, GF_LOG_ERROR,
"Out of memory");
@@ -642,7 +643,8 @@ init (xlator_t *this)
}
}
- conf->du_stats = CALLOC (conf->subvolume_cnt, sizeof (dht_du_t));
+ conf->du_stats = GF_CALLOC (conf->subvolume_cnt, sizeof (dht_du_t),
+ gf_dht_mt_dht_du_t);
if (!conf->du_stats) {
gf_log (this->name, GF_LOG_ERROR,
"Out of memory");
@@ -657,24 +659,24 @@ err:
if (conf) {
if (conf->file_layouts) {
for (i = 0; i < conf->subvolume_cnt; i++) {
- FREE (conf->file_layouts[i]);
+ GF_FREE (conf->file_layouts[i]);
}
- FREE (conf->file_layouts);
+ GF_FREE (conf->file_layouts);
}
if (conf->default_dir_layout)
- FREE (conf->default_dir_layout);
+ GF_FREE (conf->default_dir_layout);
if (conf->subvolumes)
- FREE (conf->subvolumes);
+ GF_FREE (conf->subvolumes);
if (conf->subvolume_status)
- FREE (conf->subvolume_status);
+ GF_FREE (conf->subvolume_status);
if (conf->du_stats)
- FREE (conf->du_stats);
+ GF_FREE (conf->du_stats);
- FREE (conf);
+ GF_FREE (conf);
}
return -1;