summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.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/performance/io-threads/src/io-threads.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/performance/io-threads/src/io-threads.c')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 5ef716733..c2cca7888 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -2111,6 +2111,24 @@ set_stack_size (iot_conf_t *conf)
}
}
+int32_t
+mem_acct_init (xlator_t *this)
+{
+ int ret = -1;
+
+ if (!this)
+ return ret;
+
+ ret = xlator_mem_acct_init (this, gf_iot_mt_end + 1);
+
+ if (ret != 0) {
+ gf_log (this->name, GF_LOG_ERROR, "Memory accounting init"
+ "failed");
+ return ret;
+ }
+
+ return ret;
+}
int
init (xlator_t *this)
@@ -2132,7 +2150,8 @@ init (xlator_t *this)
"dangling volume. check volfile ");
}
- conf = (void *) CALLOC (1, sizeof (*conf));
+ conf = (void *) GF_CALLOC (1, sizeof (*conf),
+ gf_iot_mt_iot_conf_t);
if (conf == NULL) {
gf_log (this->name, GF_LOG_ERROR,
"out of memory");
@@ -2169,7 +2188,7 @@ init (xlator_t *this)
if (ret == -1) {
gf_log (this->name, GF_LOG_ERROR,
"cannot initialize worker threads, exiting init");
- FREE (conf);
+ GF_FREE (conf);
goto out;
}
@@ -2185,7 +2204,7 @@ fini (xlator_t *this)
{
iot_conf_t *conf = this->private;
- FREE (conf);
+ GF_FREE (conf);
this->private = NULL;
return;