summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-05-03 00:27:16 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-03 23:40:20 -0700
commitcdb67095fd35bc647098981e9e2687226196a645 (patch)
treeefc11f7016b09e73926b66fd7f7b3db0e9bc0c4d
parentb8f058432a09f6e217506be7bc4576e65186107a (diff)
fix memory leak in stat-prefetch.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 878 (Memory leak in stat-prefetch) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=878
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 0e77abc..f6aad15 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
};