summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/src/ioc-inode.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-cache/src/ioc-inode.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-cache/src/ioc-inode.c')
-rw-r--r--xlators/performance/io-cache/src/ioc-inode.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/performance/io-cache/src/ioc-inode.c b/xlators/performance/io-cache/src/ioc-inode.c
index 763f329db14..5619134814c 100644
--- a/xlators/performance/io-cache/src/ioc-inode.c
+++ b/xlators/performance/io-cache/src/ioc-inode.c
@@ -23,6 +23,7 @@
#endif
#include "io-cache.h"
+#include "ioc-mem-types.h"
extern int ioc_log2_page_size;
@@ -51,7 +52,7 @@ ptr_to_str (void *ptr)
{
int ret = 0;
char *str = NULL;
- ret = asprintf (&str, "%p", ptr);
+ ret = gf_asprintf (&str, "%p", ptr);
if (-1 == ret) {
gf_log ("ioc", GF_LOG_ERROR,
"asprintf failed while converting ptr to str");
@@ -137,7 +138,7 @@ ioc_inode_wakeup (call_frame_t *frame, ioc_inode_t *ioc_inode,
waiter = waiter->next;
waited->data = NULL;
- free (waited);
+ GF_FREE (waited);
}
}
@@ -157,7 +158,8 @@ ioc_inode_update (ioc_table_t *table, inode_t *inode, uint32_t weight)
ioc_inode_t *ioc_inode = NULL;
unsigned long no_of_pages = 0;
- ioc_inode = CALLOC (1, sizeof (ioc_inode_t));
+ ioc_inode = GF_CALLOC (1, sizeof (ioc_inode_t),
+ gf_ioc_mt_ioc_inode_t);
if (ioc_inode == NULL) {
goto out;
}
@@ -213,5 +215,5 @@ ioc_inode_destroy (ioc_inode_t *ioc_inode)
rbthash_table_destroy (ioc_inode->cache.page_table);
pthread_mutex_destroy (&ioc_inode->inode_lock);
- free (ioc_inode);
+ GF_FREE (ioc_inode);
}