diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-04-22 13:33:09 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-04-23 06:32:52 -0700 |
commit | 582de0677da4be19fc6f873625c58c45d069ab1c (patch) | |
tree | f10cb3e26e1f92f6ea91034e6f7bb925790dd9bc /xlators/cluster/dht/src/dht-layout.c | |
parent | 72baa17282f5cf749fa743fd601c7b728ece4fa2 (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/dht-layout.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-layout.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c index 86d3c4410fc..41b6896743f 100644 --- a/xlators/cluster/dht/src/dht-layout.c +++ b/xlators/cluster/dht/src/dht-layout.c @@ -44,7 +44,8 @@ dht_layout_new (xlator_t *this, int cnt) conf = this->private; - layout = CALLOC (1, layout_size (cnt)); + layout = GF_CALLOC (1, layout_size (cnt), + gf_dht_mt_dht_layout_t); if (!layout) { gf_log (this->name, GF_LOG_ERROR, "Out of memory"); @@ -131,7 +132,7 @@ dht_layout_unref (xlator_t *this, dht_layout_t *layout) UNLOCK (&conf->layout_lock); if (!ref) - FREE (layout); + GF_FREE (layout); } @@ -218,8 +219,9 @@ dht_layouts_init (xlator_t *this, dht_conf_t *conf) int ret = -1; - conf->file_layouts = CALLOC (conf->subvolume_cnt, - sizeof (dht_layout_t *)); + conf->file_layouts = GF_CALLOC (conf->subvolume_cnt, + sizeof (dht_layout_t *), + gf_dht_mt_dht_layout_t); if (!conf->file_layouts) { gf_log (this->name, GF_LOG_ERROR, "Out of memory"); @@ -253,7 +255,8 @@ dht_disk_layout_extract (xlator_t *this, dht_layout_t *layout, int ret = -1; int32_t *disk_layout = NULL; - disk_layout = CALLOC (5, sizeof (int)); + disk_layout = GF_CALLOC (5, sizeof (int), + gf_dht_mt_int32_t); if (!disk_layout) { gf_log (this->name, GF_LOG_ERROR, "Out of memory"); |