summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-04-06 06:13:13 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-07 02:41:08 -0700
commit6f67027d787b72f2de9e35740ff5650083c4d29e (patch)
tree1fda2d92caefdf11a8db9dcf91a56c1c2f73c466
parent391023ddc5bcd1c6b8f2782d8b1c41c614f5e200 (diff)
cluster/afr: Cleanup fd ctx in releasedir cbkv3.0.4rc4
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 805 (memory leak in afr) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=805
-rw-r--r--xlators/cluster/afr/src/afr-dir-read.c2
-rw-r--r--xlators/cluster/afr/src/afr.c18
-rw-r--r--xlators/cluster/afr/src/afr.h3
3 files changed, 17 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-read.c b/xlators/cluster/afr/src/afr-dir-read.c
index d0eadebd9bd..92e23659f32 100644
--- a/xlators/cluster/afr/src/afr-dir-read.c
+++ b/xlators/cluster/afr/src/afr-dir-read.c
@@ -770,7 +770,7 @@ int32_t
afr_releasedir (xlator_t *this, fd_t *fd)
{
afr_forget_entries (fd);
-
+ afr_cleanup_fd_ctx (this, fd);
return 0;
}
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index c041adc99e0..9ca5728673e 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -1421,12 +1421,11 @@ out:
int
-afr_release (xlator_t *this, fd_t *fd)
+afr_cleanup_fd_ctx (xlator_t *this, fd_t *fd)
{
- uint64_t ctx;
- afr_fd_ctx_t * fd_ctx;
-
- int ret = 0;
+ uint64_t ctx = 0;
+ afr_fd_ctx_t *fd_ctx = NULL;
+ int ret = 0;
ret = fd_ctx_get (fd, this, &ctx);
@@ -1453,6 +1452,15 @@ out:
}
+int
+afr_release (xlator_t *this, fd_t *fd)
+{
+ afr_cleanup_fd_ctx (this, fd);
+
+ return 0;
+}
+
+
/* {{{ fsync */
int
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index a5c75add7ba..4ea36886726 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -631,6 +631,9 @@ afr_is_opendir_done (xlator_t *this, inode_t *inode);
void
afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this);
+int
+afr_cleanup_fd_ctx (xlator_t *this, fd_t *fd);
+
#define AFR_STACK_UNWIND(fop, frame, params ...) \
do { \
afr_local_t *__local = NULL; \