summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/fd.c
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-08-10 16:58:38 +0530
committerVijay Bellur <vijay@gluster.com>2011-08-25 12:01:08 -0700
commitcd567c063ec25b280d3fb5686a69b068c2d6d6df (patch)
tree636ed83dc9b7e4d7e019dcfc59bbc722f066e2e6 /libglusterfs/src/fd.c
parent9c68f3b53ffd27ea03e90da883c43e84bf94dd15 (diff)
mem-pool: Make mem-pool ptr avialable in ptr
The header of the ptr returned from mem-pool will now store the mem-pool ptr it belongs to. mem_put will now take only the pointer to be freed. Also, changing MALLOC call to GF_CALLOC in mem_get when we run out of entries in mem-pool. This also will have the header information saved. Change-Id: I3de182663a7f5b49c9e9425e9531775b70bdff67 BUG: 3390 Reviewed-on: http://review.gluster.com/205 Reviewed-by: Amar Tumballi <amar@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src/fd.c')
-rw-r--r--libglusterfs/src/fd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 72df5e1d395..d6c4806a11a 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -428,7 +428,7 @@ fd_destroy (fd_t *fd)
GF_FREE (fd->_ctx);
inode_unref (fd->inode);
fd->inode = (inode_t *)0xaaaaaaaa;
- mem_put (tmp_pool,fd);
+ mem_put (fd);
tmp_pool = NULL;
out:
return;
@@ -500,7 +500,7 @@ fd_create (inode_t *inode, pid_t pid)
fd->_ctx = GF_CALLOC (1, (sizeof (struct _fd_ctx) * fd->xl_count),
gf_common_mt_fd_ctx);
if (!fd->_ctx) {
- mem_put (inode->table->fd_mem_pool, fd);
+ mem_put (fd);
fd = NULL;
goto out;
}