summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/fd.c
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2010-08-05 04:00:14 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-06 03:37:36 -0700
commitf9431f330e8f304e82d9b1443018987a926d56b6 (patch)
treee5f91f4f8f0cb9b3387f209944127022d915b598 /libglusterfs/src/fd.c
parent767b6b7d3f5b5e96e13f459fae6260d7cb129403 (diff)
mem pool for fd_t
Ran posix compliance test and sanity test Signed-off-by: shishir gowda <shishirng@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 'libglusterfs/src/fd.c')
-rw-r--r--libglusterfs/src/fd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 9269e5cf838..231b7c5b00c 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -402,6 +402,7 @@ fd_destroy (fd_t *fd)
xlator_t *xl = NULL;
int i = 0;
xlator_t *old_THIS = NULL;
+ struct mem_pool *tmp_pool = NULL;
if (fd == NULL){
gf_log ("xlator", GF_LOG_ERROR, "invalid arugument");
@@ -415,6 +416,8 @@ fd_destroy (fd_t *fd)
if (!fd->_ctx)
goto out;
+ tmp_pool = fd->inode->table->fd_mem_pool;
+
if (IA_ISDIR (fd->inode->ia_type)) {
for (i = 0; i < fd->inode->table->xl->graph->xl_count; i++) {
if (fd->_ctx[i].key) {
@@ -444,7 +447,8 @@ fd_destroy (fd_t *fd)
GF_FREE (fd->_ctx);
inode_unref (fd->inode);
fd->inode = (inode_t *)0xaaaaaaaa;
- GF_FREE (fd);
+ mem_put (tmp_pool,fd);
+ tmp_pool = NULL;
out:
return;
}
@@ -505,7 +509,7 @@ fd_create (inode_t *inode, pid_t pid)
return NULL;
}
- fd = GF_CALLOC (1, sizeof (fd_t), gf_common_mt_fd_t);
+ fd = mem_get (inode->table->fd_mem_pool);
if (!fd)
goto out;