From a53cd95827df0a9c560fdf5e07b0c23d03707b04 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sun, 6 Dec 2009 05:31:44 +0000 Subject: THIS: set THIS pointers before forget/release/releasedir callbacks Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati --- libglusterfs/src/fd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libglusterfs/src/fd.c') diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c index 59e702dd9de..c6b060c61a5 100644 --- a/libglusterfs/src/fd.c +++ b/libglusterfs/src/fd.c @@ -385,6 +385,7 @@ fd_destroy (fd_t *fd) { xlator_t *xl = NULL; int i = 0; + xlator_t *old_THIS = NULL; if (fd == NULL){ gf_log ("xlator", GF_LOG_ERROR, "invalid arugument"); @@ -402,16 +403,22 @@ fd_destroy (fd_t *fd) for (i = 0; i < fd->inode->table->xl->ctx->xl_count; i++) { if (fd->_ctx[i].key) { xl = (xlator_t *)(long)fd->_ctx[i].key; + old_THIS = THIS; + THIS = xl; if (xl->cbks->releasedir) xl->cbks->releasedir (xl, fd); + THIS = old_THIS; } } } else { for (i = 0; i < fd->inode->table->xl->ctx->xl_count; i++) { if (fd->_ctx[i].key) { xl = (xlator_t *)(long)fd->_ctx[i].key; + old_THIS = THIS; + THIS = xl; if (xl->cbks->release) xl->cbks->release (xl, fd); + THIS = old_THIS; } } } -- cgit