From cdb67095fd35bc647098981e9e2687226196a645 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 3 May 2010 00:27:16 +0000 Subject: fix memory leak in stat-prefetch. Signed-off-by: Raghavendra G Signed-off-by: Anand V. Avati BUG: 878 (Memory leak in stat-prefetch) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=878 --- xlators/performance/stat-prefetch/src/stat-prefetch.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 0e77abc08..f6aad159e 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -4045,6 +4045,23 @@ sp_release (xlator_t *this, fd_t *fd) } +int32_t +sp_forget (xlator_t *this, inode_t *inode) +{ + sp_inode_ctx_t *buf = NULL; + uint64_t value = 0; + + inode_ctx_del (inode, this, &value); + + if (value) { + buf = (void *)(long)value; + FREE (buf); + } + + return 0; +} + + int32_t init (xlator_t *this) { @@ -4118,6 +4135,7 @@ struct xlator_mops mops = { }; struct xlator_cbks cbks = { + .forget = sp_forget, .release = sp_release, .releasedir = sp_release }; -- cgit