From 1979cee4716fdb95909654148eebb8b0b973f484 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 21 Feb 2012 11:18:32 +0530 Subject: features/index: Add release, releasedir cbks Change-Id: Ice45a0b4e953e270273aa4155a895d6ec033fda8 BUG: 763820 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/2780 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/index/src/index.c | 41 +++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'xlators/features/index/src/index.c') diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 34b0ec8e7..636c0f6da 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -1094,6 +1094,43 @@ index_forget (xlator_t *this, inode_t *inode) return 0; } +int32_t +index_releasedir (xlator_t *this, fd_t *fd) +{ + index_fd_ctx_t *fctx = NULL; + uint64_t ctx = 0; + int ret = 0; + + ret = fd_ctx_del (fd, this, &ctx); + if (ret < 0) + goto out; + + fctx = (index_fd_ctx_t*) (long) ctx; + if (fctx->dir) + closedir (fctx->dir); + + GF_FREE (fctx); +out: + return 0; +} + +int32_t +index_release (xlator_t *this, fd_t *fd) +{ + index_fd_ctx_t *fctx = NULL; + uint64_t ctx = 0; + int ret = 0; + + ret = fd_ctx_del (fd, this, &ctx); + if (ret < 0) + goto out; + + fctx = (index_fd_ctx_t*) (long) ctx; + GF_FREE (fctx); +out: + return 0; +} + int notify (xlator_t *this, int event, void *data, ...) { @@ -1117,7 +1154,9 @@ struct xlator_dumpops dumpops = { }; struct xlator_cbks cbks = { - .forget = index_forget, + .forget = index_forget, + .release = index_release, + .releasedir = index_releasedir }; struct volume_options options[] = { -- cgit